Skip to content

Commit

Permalink
improve further test rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed Dec 21, 2023
1 parent 448b485 commit 8526042
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions test/allocation_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@ function alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α)
return nothing
end

@testset "Allocation test in preprocess and solvemodel" for (Data, solve) in (
(PDataKARC, AdaptiveRegularization.solve_modelKARC),
(PDataTRK, AdaptiveRegularization.solve_modelTRK),
(PDataST, AdaptiveRegularization.solve_modelST_TR),
)
XData = Data(S, T, n)
@testset "Allocation test in preprocess with $(Data)" begin
alloc_preprocess(XData, H, g, ng, calls, max_calls, α)
al = @allocated alloc_preprocess(XData, H, g, ng, calls, max_calls, α)
@test al == 0
end
@testset "Allocation test in preprocess and solvemodel" begin
for (Data, solve) in (
(PDataKARC, AdaptiveRegularization.solve_modelKARC),
(PDataTRK, AdaptiveRegularization.solve_modelTRK),
(PDataST, AdaptiveRegularization.solve_modelST_TR),
)
XData = Data(S, T, n)
@testset "Allocation test in preprocess with $(Data)" begin
alloc_preprocess(XData, H, g, ng, calls, max_calls, α)
al = @allocated alloc_preprocess(XData, H, g, ng, calls, max_calls, α)
@test al == 0
end

@testset "Allocation test in $solve with $(Data)" begin
alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α)
al = @allocated alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α)
@test al == 0
@testset "Allocation test in $solve with $(Data)" begin
alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α)
al = @allocated alloc_solve_model(solve, XData, H, g, ng, calls, max_calls, α)
@test al == 0
end
end
end

0 comments on commit 8526042

Please sign in to comment.