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
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Expand Down
28 changes: 28 additions & 0 deletions test/jet.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using SparseBandedMatrices, JET, LinearAlgebra

@testset "JET static analysis" begin
# Test that there are no unresolved dispatch errors in key functions
@testset "Error-free analysis" begin
rep = JET.report_call(getindex, (SparseBandedMatrix{Float64}, Int, Int))
@test length(JET.get_reports(rep)) == 0

rep = JET.report_call(setindex!, (SparseBandedMatrix{Float64}, Float64, Int, Int))
@test length(JET.get_reports(rep)) == 0

rep = JET.report_call(size, (SparseBandedMatrix{Float64},))
@test length(JET.get_reports(rep)) == 0

rep = JET.report_call(setdiagonal!, (SparseBandedMatrix{Float64}, Vector{Float64}, Bool))
@test length(JET.get_reports(rep)) == 0
end

@testset "Type stability for core operations" begin
# Test getindex type stability
rep = JET.report_opt(getindex, (SparseBandedMatrix{Float64}, Int, Int))
@test length(JET.get_reports(rep)) == 0

# Test size type stability
rep = JET.report_opt(size, (SparseBandedMatrix{Float64},))
@test length(JET.get_reports(rep)) == 0
end
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ using SafeTestsets, Test

@testset "SparseBandedMatrices" begin
@safetestset "Quality Assurance" include("qa.jl")
@safetestset "JET Static Analysis" include("jet.jl")

@safetestset "Constructors" begin
using SparseBandedMatrices
Expand Down
Loading