Skip to content

Commit

Permalink
simplify jet tests (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Krastanov authored Sep 12, 2024
1 parent 7032c1a commit 3853538
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions test/test_jet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,11 @@ using Test
using PyQDecoders
using JET

using JET: ReportPass, BasicPass, InferenceErrorReport, UncaughtExceptionReport

# Custom report pass that ignores `UncaughtExceptionReport`
# Too coarse currently, but it serves to ignore the various
# "may throw" messages for runtime errors we raise on purpose
# (mostly on malformed user input)
struct MayThrowIsOk <: ReportPass end

# ignores `UncaughtExceptionReport` analyzed by `JETAnalyzer`
(::MayThrowIsOk)(::Type{UncaughtExceptionReport}, @nospecialize(_...)) = return

# forward to `BasicPass` for everything else
function (::MayThrowIsOk)(report_type::Type{<:InferenceErrorReport}, @nospecialize(args...))
BasicPass()(report_type, args...)
end

# imported to be declared as modules filtered out from analysis result
using CondaPkg, PythonCall

@testset "JET checks" begin
rep = report_package("PyQDecoders";
report_pass=MayThrowIsOk(),
ignored_modules=(
AnyFrameModule(CondaPkg),
AnyFrameModule(PythonCall),
Expand Down

0 comments on commit 3853538

Please sign in to comment.