Skip to content

Commit 21a2b25

Browse files
committed
fix handling off setup.jl file
1 parent 629e5c1 commit 21a2b25

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
88
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
99
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1010
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
11+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1112
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1213

1314
[compat]
1415
Dates = "1"
1516
Distributed = "1"
1617
Printf = "1"
1718
REPL = "1"
19+
Random = "1"
1820
Test = "1"
19-
julia = "1.10"
21+
julia = "1.10"

src/ParallelTestRunner.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import REPL
88
using Printf: @sprintf
99
using Base.Filesystem: path_separator
1010
import Test
11+
import Random
1112

1213
include("setup.jl")
1314

src/setup.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ function __runtests(f, name)
1313
# generate a temporary module to execute the tests in
1414
mod_name = Symbol("Test", rand(1:100), "Main_", replace(name, '/' => '_'))
1515
mod = @eval(Main, module $mod_name end)
16-
@eval(mod, using Test, Random)
16+
@eval(mod, import ParallelTestRunner: Test, Random)
17+
@eval(mod, using .Test, .Random)
1718

1819
let id = myid()
1920
wait(@spawnat 1 print_testworker_started(name, id))
@@ -24,7 +25,7 @@ function __runtests(f, name)
2425
Random.seed!(1)
2526

2627
res = @timed @testset $name begin
27-
include($f)
28+
Main.include($f)
2829
end
2930
res..., 0, 0, 0
3031
end

test/setup.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function somefunc()
2+
return true
3+
end
4+
5+
nothing # File is loaded via a remotecall to "include". Ensure it returns "nothing".

test/test_setup.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@test somefunc()
2+
@test Main.somefunc()

0 commit comments

Comments
 (0)