Skip to content

Commit

Permalink
add tests and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanemac committed Sep 13, 2024
1 parent 70ef55f commit 769f862
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
17 changes: 12 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ uuid = "925ea013-038b-5ab6-a1ab-e0849925e528"
authors = ["Nathan Allaire <[email protected]> and contributors"]
version = "0.1.0"

[compat]
julia = "1.9"

[deps]
OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
LAPACK_jll = "51474c39-65e3-53ba-86ba-03b1b862ec14"
proxTV_jll = "700117f8-5dbb-54dd-9908-6f3eb0e21f87"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2"
proxTV_jll = "700117f8-5dbb-54dd-9908-6f3eb0e21f87"

[compat]
julia = "1.9"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
16 changes: 15 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
using ProxTV
using Test
using LinearAlgebra

@testset "ProxTV.jl" begin
@test ProxTV.hello_world() == "Hello, World!"
# test on a basic function :
n = 4
x = rand(n)
p = 2.0
@test isapprox(ProxTV.LPnorm(x, n, p), norm(x), atol = 1e-5)

# test on a more advanced function :
lambda = 0.18
info = []
y = rand(n)
x = zeros(n)
ws = ProxTV.newWorkspace(n)
@test ProxTV.TV(y, lambda, x, info, n, p, ws) == 1 # 1 is the expected return value of the function

end

0 comments on commit 769f862

Please sign in to comment.