Skip to content

Commit

Permalink
Add solvertest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed Apr 5, 2024
1 parent 14064ea commit bd6f79b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
7 changes: 1 addition & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mutable struct DummyModel{T, S} <: AbstractNLPModel{T, S}
end

include("allocs.jl")
include("solvertest.jl")

function test()
nlp = DummyModel(NLPModelMeta(1, minimize = false))
Expand All @@ -18,12 +19,6 @@ function test()
)

lbfgs_mem = 4
@testset "Unconstrained tests" begin
unconstrained_nlp(percival)
end
@testset "Bound-constrained tests" begin
bound_constrained_nlp(percival)
end

@testset "Small equality constrained problems $name" for (x0, m, f, c, sol, name) in [
(
Expand Down
27 changes: 27 additions & 0 deletions test/solvertest.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@testset "Testing Percival with SolverTest" begin
@testset "Percival NLP" for foo in [
unconstrained_nlp,
bound_constrained_nlp,
equality_constrained_nlp,
]
foo(nlp -> percival(nlp))
end

@testset "Percival NLS" for foo in [
unconstrained_nls,
bound_constrained_nls,
equality_constrained_nls,
]
foo(nlp -> percival(nlp))
end

@testset "Multiprecision tests" begin
for ptype in [:unc, :bnd, :equ, :ineq, :eqnbnd, :gen]
multiprecision_nlp(
(nlp; kwargs...) -> percival(nlp; kwargs...),
ptype,
precisions = (Float16, Float32, Float64, BigFloat),
) # precisions = (Float16, Float32, Float64, BigFloat)
end
end
end

0 comments on commit bd6f79b

Please sign in to comment.