-
Notifications
You must be signed in to change notification settings - Fork 119
/
runtests.jl
69 lines (60 loc) · 2.28 KB
/
runtests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using Convex
using Convex.ProblemDepot: run_tests
using Test
using SCS, ECOS, GLPK
using MathOptInterface
const MOI = MathOptInterface
const MOIU = MOI.Utilities
# Seed random number stream to improve test reliability
using Random
Random.seed!(2)
@testset "ProblemDepot" begin
@testset "Problems can run without `solve!`ing if `test==false`; T=$T" for T in (Float64, BigFloat)
Convex.ProblemDepot.foreach_problem() do name, func
@testset "$name" begin
# We want to check to make sure this does not throw
func(Val(false), 0.0, 0.0, T) do problem
@test problem isa Convex.Problem{T} # check numeric type
model = MOIU.MockOptimizer(MOIU.Model{T}())
Convex.load_MOI_model!(model, problem) # make sure it loads without throwing
end
end
end
end
end
@testset "Definitions" begin
include("definitions.jl")
end
@testset "Convex" begin
include("test_utilities.jl")
include("test_abstract_variable.jl")
@testset "SCS with warmstarts" begin
# "sdp_lieb_ando" is currently (14 Nov 2021) failing with SCS
# on ubuntu in CI (they pass locally on MacOS and in CI with
# MacOS, and have passed on ubuntu in the past). Disabling
# them for now; once COSMO or Hypatia is on MOI v0.10, we can
# try using them, or hope SCS starts solving them again.
#
# "sdp_sdp_constraints" is failing with MOI v0.9 on ubuntu.
run_tests(; exclude=[r"mip", r"sdp_lieb_ando", r"sdp_sdp_constraints"]) do p
solve!(p, () -> SCS.Optimizer(verbose=0, eps=1e-6); warmstart = true)
end
end
@testset "SCS" begin
run_tests(; exclude=[r"mip", r"sdp_lieb_ando", r"sdp_sdp_constraints"]) do p
solve!(p, () -> SCS.Optimizer(verbose=0, eps=1e-6))
end
end
@testset "ECOS" begin
run_tests(; exclude=[r"mip", r"sdp"]) do p
solve!(p, ECOS.Optimizer; silent_solver=true)
end
end
@testset "GLPK" begin
# Note this is an inclusion, not exclusion;
# we only test GLPK with MIPs, since those we can't test elsewhere.
run_tests([r"mip"]) do p
solve!(p, GLPK.Optimizer; silent_solver=true)
end
end
end