Skip to content

Commit fe471c6

Browse files
committed
runtests: allow passing a pattern when no module is passed
1 parent 15d291f commit fe471c6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/InlineTest.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,11 @@ function wrap_ts(partial, regex, ts::TestsetExpr, loopvals=nothing)
212212
end
213213
end
214214

215-
function runtests(; wrap::Bool=true)
215+
function runtests(pattern::Union{AbstractString,Regex} = r""; wrap::Bool=true)
216216
foreach(values(Base.loaded_modules)) do m
217-
if isdefined(m, INLINE_TEST[]) # will automatically skip InlineTest and InlineTest.InlineTestTest
218-
ts = runtests(m, wrap=wrap)
217+
if isdefined(m, INLINE_TEST[])
218+
# will automatically skip InlineTest and InlineTest.InlineTestTest
219+
runtests(m, pattern, wrap=wrap)
219220
end
220221
end
221222
end

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,6 @@ end
152152
import .P # test InlineTest's wrapping of non-regex patterns
153153
P.check("b", ["a", "b", "b|c"]) # an implicit prefix r".*" is added
154154
P.check("b|c", ["a", "b|c"]) # "b" is not matched
155+
156+
runtests()
157+
runtests(r"/a") # just test that a regex can be passed

0 commit comments

Comments
 (0)