Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/manual/implementing.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Project.toml
The best way to implement an interface to MathOptInterface is via
[test-driven development](https://en.wikipedia.org/wiki/Test-driven_development).

The [`MOI.Test` submodule](@ref test_module) contains a large test suite to help
The [`MOI.DeprecatedTest` submodule](@ref test_module) contains a large test suite to help
check that you have implemented things correctly.

Follow the guide [How to test a solver](@ref) to set up the tests for your
Expand Down
46 changes: 23 additions & 23 deletions docs/src/submodules/Test/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const OPTIMIZER = MOI.instantiate(OPTIMIZER_CONSTRUCTOR)
const BRIDGED = MOI.instantiate(
OPTIMIZER_CONSTRUCTOR, with_bridge_type = Float64
)
const CONFIG = MOI.Test.Config(
const CONFIG = MOI.DeprecatedTest.Config(
# Modify tolerances as necessary.
atol = 1e-6,
rtol = 1e-6,
Expand All @@ -68,61 +68,61 @@ function test_supports_incremental_interface()
end

function test_unittest()
# Test all the functions included in dictionary `MOI.Test.unittests`,
# Test all the functions included in dictionary `MOI.DeprecatedTest.unittests`,
# except functions "number_threads" and "solve_qcp_edge_cases."
MOI.Test.unittest(
MOI.DeprecatedTest.unittest(
BRIDGED,
CONFIG,
["number_threads", "solve_qcp_edge_cases"]
)
end

function test_modification()
MOI.Test.modificationtest(BRIDGED, CONFIG)
MOI.DeprecatedTest.modificationtest(BRIDGED, CONFIG)
end

function test_contlinear()
MOI.Test.contlineartest(BRIDGED, CONFIG)
MOI.DeprecatedTest.contlineartest(BRIDGED, CONFIG)
end

function test_contquadratictest()
MOI.Test.contquadratictest(OPTIMIZER, CONFIG)
MOI.DeprecatedTest.contquadratictest(OPTIMIZER, CONFIG)
end

function test_contconic()
MOI.Test.contlineartest(BRIDGED, CONFIG)
MOI.DeprecatedTest.contlineartest(BRIDGED, CONFIG)
end

function test_intconic()
MOI.Test.intconictest(BRIDGED, CONFIG)
MOI.DeprecatedTest.intconictest(BRIDGED, CONFIG)
end

function test_default_objective_test()
MOI.Test.default_objective_test(OPTIMIZER)
MOI.DeprecatedTest.default_objective_test(OPTIMIZER)
end

function test_default_status_test()
MOI.Test.default_status_test(OPTIMIZER)
MOI.DeprecatedTest.default_status_test(OPTIMIZER)
end

function test_nametest()
MOI.Test.nametest(OPTIMIZER)
MOI.DeprecatedTest.nametest(OPTIMIZER)
end

function test_validtest()
MOI.Test.validtest(OPTIMIZER)
MOI.DeprecatedTest.validtest(OPTIMIZER)
end

function test_emptytest()
MOI.Test.emptytest(OPTIMIZER)
MOI.DeprecatedTest.emptytest(OPTIMIZER)
end

function test_orderedindicestest()
MOI.Test.orderedindicestest(OPTIMIZER)
MOI.DeprecatedTest.orderedindicestest(OPTIMIZER)
end

function test_scalar_function_constant_not_zero()
MOI.Test.scalar_function_constant_not_zero(OPTIMIZER)
MOI.DeprecatedTest.scalar_function_constant_not_zero(OPTIMIZER)
end

# This function runs all functions in this module starting with `test_`.
Expand All @@ -141,14 +141,14 @@ end # module TestFooBar
TestFooBar.runtests()
```

Test functions like `MOI.Test.unittest` and `MOI.Test.modificationtest` are
wrappers around corresponding dictionaries `MOI.Test.unittests` and
`MOI.Test.modificationtests`. Exclude tests by passing a vector of strings
Test functions like `MOI.DeprecatedTest.unittest` and `MOI.DeprecatedTest.modificationtest` are
wrappers around corresponding dictionaries `MOI.DeprecatedTest.unittests` and
`MOI.DeprecatedTest.modificationtests`. Exclude tests by passing a vector of strings
corresponding to the test keys you want to exclude as the third positional
argument to the test function.

!!! tip
Print a list of all keys using `println.(keys(MOI.Test.unittests))`
Print a list of all keys using `println.(keys(MOI.DeprecatedTest.unittests))`

The optimizer `BRIDGED` constructed with [`instantiate`](@ref)
automatically bridges constraints that are not supported by `OPTIMIZER`
Expand All @@ -162,7 +162,7 @@ To test that a specific problem can be solved without bridges, a specific test
can be added with `OPTIMIZER` instead of `BRIDGED`. For example:
```julia
function test_interval_constraints()
MOI.Test.linear10test(OPTIMIZER, CONFIG)
MOI.DeprecatedTest.linear10test(OPTIMIZER, CONFIG)
end
```
checks that `OPTIMIZER` implements support for
Expand All @@ -176,7 +176,7 @@ To give an example, ECOS errored calling [`optimize!`](@ref) twice in a row.
We could add a test to ECOS.jl, but that would only stop us from re-introducing
the bug to ECOS.jl in the future.

Instead, if we add a test to `MOI.Test`, then all solvers will also check that
Instead, if we add a test to `MOI.DeprecatedTest`, then all solvers will also check that
they handle a double optimize call!

For this test, we care about correctness, rather than performance. therefore, we
Expand Down Expand Up @@ -217,7 +217,7 @@ To resolve this issue, follow these steps (tested on Julia v1.5):
```
2. Add a test for the test you just wrote. (We test the tests!)
a. Add the name of the test (`"solve_twice"`) to the end of the array in
`MOI.Test.unittest(...)` ([link](https://github.com/jump-dev/MathOptInterface.jl/blob/7543afe4b5151cf36bbd18181c1bb5c83266ae2f/test/Test/unit.jl#L51-L52)).
`MOI.DeprecatedTest.unittest(...)` ([link](https://github.com/jump-dev/MathOptInterface.jl/blob/7543afe4b5151cf36bbd18181c1bb5c83266ae2f/test/Test/unit.jl#L51-L52)).
b. Add a test for the test towards the end of the "Unit Tests" test set
([link](https://github.com/jump-dev/MathOptInterface.jl/blob/7543afe4b5151cf36bbd18181c1bb5c83266ae2f/test/Test/unit.jl#L394)).
The test should look something like
Expand All @@ -235,7 +235,7 @@ To resolve this issue, follow these steps (tested on Julia v1.5):
(MOI.FEASIBLE_POINT, [1.0]),
)
)
MOI.Test.solve_twice(mock, config)
MOI.DeprecatedTest.solve_twice(mock, config)
end
```
In the above `mock` is a `MOI.Utilities.MockOptimizer` that is defined
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Test.jl → src/DeprecatedTest/DeprecatedTest.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Test
module DeprecatedTest

using MathOptInterface
const MOI = MathOptInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ function solve_start_soc(model::MOI.ModelLike, config::Config{T}) where {T}
end
if config.solve
MOI.optimize!(model)
MOI.Test.test_model_solution(
test_model_solution(
model,
config;
objective_value = o,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Test/config.jl → src/DeprecatedTest/config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ macro moitestset(setname, subsets = false)
:(
function $testname(
model::$MOI.ModelLike,
config::$MOI.Test.Config,
config::$MOI.DeprecatedTest.Config,
exclude::Vector{String} = String[],
)
for (name, f) in $testdict
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/MathOptInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,13 @@ end

# submodules
include("Utilities/Utilities.jl") # MOI.Utilities
include("Test/Test.jl") # MOI.Test
# include("Test/Test.jl") # MOI.Test
include("Bridges/Bridges.jl") # MOI.Bridges
include("Benchmarks/Benchmarks.jl")
include("FileFormats/FileFormats.jl")

include("instantiate.jl")
include("deprecate.jl")
include("DeprecatedTest/DeprecatedTest.jl")

end
2 changes: 1 addition & 1 deletion src/Utilities/Utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end
function replace_acronym(s::AbstractString)
s = replace(s, "MathOptInterface.Utilities" => "MOIU")
s = replace(s, "MathOptInterface.Bridges" => "MOIB")
s = replace(s, "MathOptInterface.Test" => "MOIT")
s = replace(s, "MathOptInterface.DeprecatedTest" => "MOIT")
s = replace(s, "MathOptInterface" => "MOI")
return s
end
Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/bridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/det.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/flip_sign.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/functionize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/geomean.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/geomean_to_relentr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/indicator_activate_on_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/indicator_sos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/ltgt_to_interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/norm_spec_nuc_to_psd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/norm_to_lp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/quad_to_soc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/relentr_to_exp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/rsoc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/scalarize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/semi_to_binary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges
const MOIBC = MathOptInterface.Bridges.Constraint
Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/slack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/soc_to_nonconvex_quad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges
const MOIBC = MathOptInterface.Bridges.Constraint
Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/soc_to_psd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/square.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
2 changes: 1 addition & 1 deletion test/Bridges/Constraint/vectorize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test

import MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIT = MathOptInterface.DeprecatedTest
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges

Expand Down
Loading