Skip to content

Commit d6aadeb

Browse files
authored
simplify JET (#176)
1 parent 9a66a46 commit d6aadeb

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

test/test_jet.jl

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,12 @@ using Test
22
using QuantumOpticsBase
33
using JET
44

5-
using JET: ReportPass, BasicPass, InferenceErrorReport, UncaughtExceptionReport
6-
7-
# Custom report pass that ignores `UncaughtExceptionReport`
8-
# Too coarse currently, but it serves to ignore the various
9-
# "may throw" messages for runtime errors we raise on purpose
10-
# (mostly on malformed user input)
11-
struct MayThrowIsOk <: ReportPass end
12-
13-
# ignores `UncaughtExceptionReport` analyzed by `JETAnalyzer`
14-
(::MayThrowIsOk)(::Type{UncaughtExceptionReport}, @nospecialize(_...)) = return
15-
16-
# forward to `BasicPass` for everything else
17-
function (::MayThrowIsOk)(report_type::Type{<:InferenceErrorReport}, @nospecialize(args...))
18-
BasicPass()(report_type, args...)
19-
end
20-
215
# imported to be declared as modules filtered out from analysis result
226
using LinearAlgebra, LRUCache, Strided, StridedViews, Dates, SparseArrays, RandomMatrices
237

248
@testset "jet" begin
259
if get(ENV,"JET_TEST","")=="true"
2610
rep = report_package("QuantumOpticsBase";
27-
report_pass=MayThrowIsOk(), # TODO have something more fine grained than a generic "do not care about thrown errors"
2811
ignored_modules=( # TODO fix issues with these modules or report them upstream
2912
AnyFrameModule(LinearAlgebra),
3013
AnyFrameModule(LRUCache),
@@ -35,7 +18,7 @@ using LinearAlgebra, LRUCache, Strided, StridedViews, Dates, SparseArrays, Rando
3518
AnyFrameModule(RandomMatrices))
3619
)
3720
@show rep
38-
@test length(JET.get_reports(rep)) <= 29
21+
@test length(JET.get_reports(rep)) <= 24
3922
@test_broken length(JET.get_reports(rep)) == 0
4023
end
4124
end # testset

0 commit comments

Comments
 (0)