From a35b61f8538bb644124b25f64d038750e072a49f Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Thu, 12 Sep 2024 09:14:32 -0400 Subject: [PATCH 1/2] simplify jet tests --- 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..e58a69f 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)) <= 20 @test_broken length(JET.get_reports(rep)) == 0 end end # testset From b61e29eacdff5954ee8a27ee9d3feae0eb09fdaf Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Thu, 12 Sep 2024 09:39:28 -0400 Subject: [PATCH 2/2] fixup --- test/test_jet.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_jet.jl b/test/test_jet.jl index e58a69f..1eab195 100644 --- a/test/test_jet.jl +++ b/test/test_jet.jl @@ -18,7 +18,7 @@ using LinearAlgebra, LRUCache, Strided, StridedViews, Dates, SparseArrays, Rando AnyFrameModule(RandomMatrices)) ) @show rep - @test length(JET.get_reports(rep)) <= 20 + @test length(JET.get_reports(rep)) <= 24 @test_broken length(JET.get_reports(rep)) == 0 end end # testset