Skip to content

Commit c5bd4cc

Browse files
committed
handle being turned into a package
1 parent 206b3f0 commit c5bd4cc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/ParallelTestRunner.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using Printf: @sprintf
99
using Base.Filesystem: path_separator
1010
import Test
1111

12+
include("setup.jl")
13+
1214
#Always set the max rss so that if tests add large global variables (which they do) we don't make the GC's life too hard
1315
if Sys.WORD_SIZE == 64
1416
const JULIA_TEST_MAXRSS_MB = 3800
@@ -103,10 +105,10 @@ function runtests(ARGS, testfilter = _ -> true)
103105

104106
append!(tests, files)
105107
for file in files
106-
test_runners[file] = () -> include("$WORKDIR/$file.jl")
108+
test_runners[file] = joinpath("$WORKDIR", "$file.jl")
107109
end
108110
end
109-
sort!(tests; by = (file) -> stat("$WORKDIR/$file.jl").size, rev = true)
111+
sort!(tests; by = (file) -> stat(joinpath("$WORKDIR", "$file.jl")).size, rev = true)
110112
## finalize
111113
unique!(tests)
112114

@@ -294,7 +296,7 @@ function runtests(ARGS, testfilter = _ -> true)
294296
# run the test
295297
running_tests[test] = now()
296298
try
297-
resp = remotecall_fetch(runtests, wrkr, test_runners[test], test)
299+
resp = remotecall_fetch(__runtests, wrkr, test_runners[test], test)
298300
catch e
299301
isa(e, InterruptException) && return
300302
resp = Any[e]

src/setup.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using .Distributed, .Test
44

55
## entry point
66

7-
function runtests(f, name)
7+
function __runtests(f, name)
88
old_print_setting = Test.TESTSET_PRINT_ENABLE[]
99
if VERSION < v"1.13.0-DEV.1044"
1010
Test.TESTSET_PRINT_ENABLE[] = false
@@ -27,7 +27,7 @@ function runtests(f, name)
2727
Random.seed!(1)
2828

2929
res = @timed @testset $name begin
30-
$f()
30+
include($f)
3131
end
3232
res..., 0, 0, 0
3333
end

0 commit comments

Comments
 (0)