Skip to content

Commit dc12196

Browse files
authored
simplify jet tests (#128)
1 parent 4f32aad commit dc12196

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,32 +2,15 @@ using ConcurrentSim
22
using JET
33
using Test
44

5-
using JET: ReportPass, BasicPass, InferenceErrorReport, UncaughtExceptionReport
6-
75
using InteractiveUtils
86

9-
# Custom report pass that ignores `UncaughtExceptionReport`
10-
# Too coarse currently, but it serves to ignore the various
11-
# "may throw" messages for runtime errors we raise on purpose
12-
# (mostly on malformed user input)
13-
struct MayThrowIsOk <: ReportPass end
14-
15-
# ignores `UncaughtExceptionReport` analyzed by `JETAnalyzer`
16-
(::MayThrowIsOk)(::Type{UncaughtExceptionReport}, @nospecialize(_...)) = return
17-
18-
# forward to `BasicPass` for everything else
19-
function (::MayThrowIsOk)(report_type::Type{<:InferenceErrorReport}, @nospecialize(args...))
20-
BasicPass()(report_type, args...)
21-
end
22-
237
@testset "JET checks" begin
248
rep = report_package("ConcurrentSim";
25-
report_pass=MayThrowIsOk(),
269
ignored_modules=(
2710
AnyFrameModule(InteractiveUtils),
2811
)
2912
)
3013
@show rep
3114
@test_broken length(JET.get_reports(rep)) == 0
32-
@test length(JET.get_reports(rep)) <= 4
15+
@test length(JET.get_reports(rep)) <= 3
3316
end

0 commit comments

Comments
 (0)