Skip to content

Commit 6c369c1

Browse files
committed
test: manually filter JET reports
1 parent 3392ab5 commit 6c369c1

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

test/runtests.jl

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,27 @@ elseif test_name == "jet"
1414
set_preferences!("DynamicExpressions", "instability_check" => "disable"; force=true)
1515
using JET
1616
using DynamicExpressions
17-
if VERSION >= v"1.10"
18-
struct MyReport end
19-
function JET.configured_reports(
20-
::MyReport, reports::Vector{JET.InferenceErrorReport}
21-
)
22-
filter!(reports) do report
23-
signature = report.sig
24-
return !any(
25-
x -> occursin("NonDifferentiableDeclarationsModule", string(x)),
26-
signature,
27-
)
28-
end
29-
return reports
17+
struct MyIgnoredModule
18+
mod::Module
19+
end
20+
function JET.match_module(
21+
mod::MyIgnoredModule, @nospecialize(report::JET.InferenceErrorReport)
22+
)
23+
s_mod = string(mod.mod)
24+
any(report.vst) do vst
25+
occursin(s_mod, string(JET.linfomod(vst.linfo)))
3026
end
27+
end
28+
if VERSION >= v"1.10"
3129
JET.test_package(
32-
DynamicExpressions; target_defined_modules=true, report_config=MyReport()
30+
DynamicExpressions;
31+
target_defined_modules=true,
32+
ignored_modules=(
33+
MyIgnoredModule(DynamicExpressions.NonDifferentiableDeclarationsModule),
34+
),
3335
)
36+
# TODO: Hack to get JET to ignore modules
37+
# https://github.com/aviatesk/JET.jl/issues/570#issuecomment-2199167755
3438
end
3539
end
3640
elseif test_name == "main"

0 commit comments

Comments
 (0)