Skip to content

Commit 2309697

Browse files
committed
runtests: use again Base.loaded_modules, together with TESTED_MODULES
TESTED_MODULES doesn't work well with modules associated to a package, which are precompiled.
1 parent 361b44b commit 2309697

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/InlineTest.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,15 @@ function wrap_ts(partial, regex, ts::TestsetExpr, loopvals=nothing)
215215
end
216216

217217
function runtests(pattern::Union{AbstractString,Regex} = r""; wrap::Bool=true)
218-
foreach(TESTED_MODULES) do m
219-
if isdefined(m, INLINE_TEST[])
220-
# will automatically skip InlineTest and InlineTest.InlineTestTest
221-
runtests(m, pattern, wrap=wrap)
218+
for mods in (values(Base.loaded_modules), TESTED_MODULES)
219+
# TESTED_MODULES is not up-to-date w.r.t. package modules which have
220+
# precompilation, so we have to also look in Base.loaded_modules
221+
# TODO: look recursively in "loaded modules" which use InlineTest for sub-modules
222+
foreach(mods) do m
223+
if isdefined(m, INLINE_TEST[])
224+
# will automatically skip InlineTest and InlineTest.InlineTestTest
225+
runtests(m, pattern, wrap=wrap)
226+
end
222227
end
223228
end
224229
end

0 commit comments

Comments
 (0)