Skip to content
Merged
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
19 changes: 5 additions & 14 deletions test/test_allocations.jl
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@
function test_only_zeros(table)
for (key, vals) in table
if !isnan(vals)
@test vals == 0
vals != 0 && println(key)
end
end
end

@testset "allocations" begin
@testset "allocs QPSData" begin
for problem in qp_problems_Matrix
nlp_qps = eval(Symbol(problem * "_QPSData"))()
allocs = test_allocs_nlpmodels(nlp_qps; linear_api = true, exclude = [jac_op])
test_only_zeros(allocs)
test_zero_allocations(allocs)
end
end

@testset "allocs QP_dense" begin
for problem in qp_problems_Matrix
nlp_qm_dense = eval(Symbol(problem * "_QP_dense"))()
allocs = test_allocs_nlpmodels(nlp_qm_dense; linear_api = true, exclude = [jac_op])
test_only_zeros(allocs)
test_zero_allocations(allocs)
end
end

@testset "allocs COO QPSData" begin
for problem in qp_problems_COO
nlp_qps = eval(Symbol(problem * "_QPSData"))()
allocs = test_allocs_nlpmodels(nlp_qps; linear_api = true, exclude = [jac_op])
test_only_zeros(allocs)
test_zero_allocations(allocs)
end
end

@testset "allocs COO QP" begin
for problem in qp_problems_COO
nlp_qm_dense = eval(Symbol(problem * "_QP"))()
allocs = test_allocs_nlpmodels(nlp_qm_dense; linear_api = true, exclude = [jac_op])
test_only_zeros(allocs)
test_zero_allocations(allocs)
end
end

Expand All @@ -46,7 +37,7 @@ end
x = nlp.meta.x0
nlp_qm = QuadraticModel(nlp, x)
allocs = test_allocs_nlpmodels(nlp_qm; linear_api = true, exclude = [jac_op])
test_only_zeros(allocs)
test_zero_allocations(allocs)
end
end
end
Loading