Skip to content

Commit 12b05c4

Browse files
committed
init_worker_code
1 parent 758c3c9 commit 12b05c4

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ pocl_jll = "627d6b7a-bbe6-5189-83e7-98cc0a5aeadd"
2626

2727
[compat]
2828
pocl_jll = "7.0"
29-
ParallelTestRunner = "2"
29+
ParallelTestRunner = "2.2"

test/runtests.jl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ for test in keys(testsuite)
7979
testsuite[test] = generate_test(test, testsuite[test])
8080
end
8181

82-
const init_code = quote
82+
const init_worker_code = quote
8383
using OpenCL, pocl_jll
8484

8585
OpenCL.allowscalar(false)
@@ -89,7 +89,7 @@ const init_code = quote
8989
# Include it directly.
9090
const GPUArraysTestSuite = let
9191
mod = @eval module $(gensym())
92-
using ..Test
92+
using Test
9393
import GPUArrays
9494
gpuarrays = pathof(GPUArrays)
9595
gpuarrays_root = dirname(dirname(gpuarrays))
@@ -140,13 +140,21 @@ const init_code = quote
140140
end
141141
end
142142

143+
const init_code = quote
144+
using OpenCL, pocl_jll
145+
146+
# bring used symbols into the temporary module
147+
import ..GPUArraysTestSuite, ..testf
148+
import ..@on_device, ..targets
149+
end
150+
143151
# avoid handle exhaustion on Windows by running each test in a separate process (pocl/pocl#1941)
144-
function test_worker(test)
152+
function test_worker(_, init_worker_code)
145153
if Sys.iswindows()
146-
addworker()
154+
addworker(; init_worker_code)
147155
else
148156
nothing
149157
end
150158
end
151159

152-
runtests(OpenCL, args; testsuite, init_code, test_worker)
160+
runtests(OpenCL, args; testsuite, init_code, init_worker_code, test_worker)

0 commit comments

Comments
 (0)