From d6aadeb2d07eb3d06226e61a72cf54f8257d8196 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Fri, 13 Sep 2024 23:43:00 -0400 Subject: [PATCH] simplify JET (#176) --- test/test_jet.jl | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/test/test_jet.jl b/test/test_jet.jl index b0de70e..1eab195 100644 --- a/test/test_jet.jl +++ b/test/test_jet.jl @@ -2,29 +2,12 @@ using Test using QuantumOpticsBase 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 LinearAlgebra, LRUCache, Strided, StridedViews, Dates, SparseArrays, RandomMatrices @testset "jet" begin if get(ENV,"JET_TEST","")=="true" rep = report_package("QuantumOpticsBase"; - report_pass=MayThrowIsOk(), # TODO have something more fine grained than a generic "do not care about thrown errors" ignored_modules=( # TODO fix issues with these modules or report them upstream AnyFrameModule(LinearAlgebra), AnyFrameModule(LRUCache), @@ -35,7 +18,7 @@ using LinearAlgebra, LRUCache, Strided, StridedViews, Dates, SparseArrays, Rando AnyFrameModule(RandomMatrices)) ) @show rep - @test length(JET.get_reports(rep)) <= 29 + @test length(JET.get_reports(rep)) <= 24 @test_broken length(JET.get_reports(rep)) == 0 end end # testset