Skip to content

Commit 5374325

Browse files
committed
become compatible again with Julia 1.0 and 1.1
1 parent 57368e6 commit 5374325

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/ReTest.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ function retest(args::Union{Module,AbstractString,Regex}...;
302302
overall = length(modules) > 1
303303
root = Testset.ReTestSet("", "Overall", true)
304304

305-
tests_descs_hasbrokens = fetchtests.(modules, regex, verbose, overall)
305+
# COMPAT: `Ref` necesssary on Julia 1.0
306+
tests_descs_hasbrokens = fetchtests.(modules, Ref(regex), verbose, overall)
306307
isempty(tests_descs_hasbrokens) &&
307308
throw(ArgumentError("no modules using ReTest could be found and none were passed"))
308309

@@ -733,7 +734,7 @@ function computemodules!(modules::Vector{Module}, shuffle)
733734
push!(seen, str)
734735
end
735736
end
736-
filter!(!=(nothing), TESTED_MODULES)
737+
filter!(x -> x !== nothing, TESTED_MODULES)
737738

738739
append!(modules, Iterators.flatten((values(Base.loaded_modules), TESTED_MODULES)))
739740
unique!(modules)

src/testset.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,10 @@ macro stats(yes, ex)
586586
local diff = Base.GC_Diff(Base.gc_num(), stats)
587587
rss = Sys.maxrss() - rss
588588
compile_time = cumulative_compile_time_ns() - compile_time
589-
(time=elapsedtime/1e9, bytes=diff.allocd, gctime=diff.total_time/1e9,
590-
rss = rss, compile_time = compile_time)
589+
# COMPAT: on Julia 1.1, the form `(time=..., bytes=..., ...)` doesn't work
590+
# (macro name mangling with `#`, e.g. (#115#time = ..., ))
591+
NamedTuple{(:time, :bytes, :gctime, :rss, :compile_time)}(
592+
(elapsedtime/1e9, diff.allocd, diff.total_time/1e9, rss, compile_time))
591593
else
592594
NamedTuple()
593595
end

0 commit comments

Comments
 (0)