|
1 | 1 | using StatsBase, Test |
2 | 2 | import JET |
3 | 3 |
|
4 | | -# JET has only experimental support for Julia 1.12 currently |
5 | | -# It throws an internal `AssertionError` in the tests below |
6 | | -if VERSION < v"1.12-" |
7 | | - @testset "JET" begin |
8 | | - # Check that there are no undefined global references and undefined field accesses |
9 | | - JET.test_package("StatsBase"; target_defined_modules = true, mode = :typo) |
| 4 | +@testset "JET" begin |
| 5 | + # Check that there are no undefined global references and undefined field accesses |
| 6 | + JET.test_package(StatsBase; target_modules = (StatsBase,), mode = :typo) |
10 | 7 |
|
11 | | - # Default error analysis for common problem fails since JET errors on interface definitions |
12 | | - # The (deprecated) `model_response(::StatisticalModel)` calls the interface |
13 | | - # function `response(::StatisticalModel)` for which no method exists yet |
14 | | - # Note: This analysis is not enough strict to guarantee that there are no runtime errors! |
15 | | - # Ref https://github.com/aviatesk/JET.jl/issues/495 |
16 | | - res = JET.report_package("StatsBase"; target_defined_modules = true, mode = :basic, toplevel_logger = nothing) |
17 | | - println(res) |
18 | | - reports = JET.get_reports(res) |
19 | | - @test_broken isempty(reports) |
20 | | - @test length(reports) <= 1 |
| 8 | + # Default error analysis |
| 9 | + # Note: This analysis is not enough strict to guarantee that there are no runtime errors! |
| 10 | + kwargs = if isdefined(JET, :LastFrameModuleExact) # JET@0.11 |
| 11 | + (; target_modules = (StatsBase,)) |
| 12 | + else |
| 13 | + (; target_defined_modules = true) |
21 | 14 | end |
| 15 | + # The (deprecated) `model_response(::StatisticalModel)` calls the interface |
| 16 | + # function `response(::StatisticalModel)` for which no method exists yet |
| 17 | + # Ref https://github.com/aviatesk/JET.jl/issues/495 |
| 18 | + res = JET.report_package(StatsBase; kwargs..., mode = :basic, toplevel_logger = nothing) |
| 19 | + println(res) |
| 20 | + reports = JET.get_reports(res) |
| 21 | + @test_broken isempty(reports) |
| 22 | + @test length(reports) <= 1 |
22 | 23 | end |
0 commit comments