Skip to content

Commit 309f1f2

Browse files
committed
Allow specifying worker launcher and cmdline flags in the test
1 parent 182f4b3 commit 309f1f2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

test/runtests.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ else
1010
typemax(Csize_t)
1111
end
1212

13+
if haskey(ENV, "JULIA_TEST_EXEFLAGS")
14+
const test_exeflags = `$(Base.shell_split(ENV["JULIA_TEST_EXEFLAGS"]))`
15+
else
16+
const test_exeflags = `--check-bounds=yes --startup-file=no --depwarn=error`
17+
end
18+
19+
if haskey(ENV, "JULIA_TEST_EXENAME")
20+
const test_exename = `$(Base.shell_split(ENV["JULIA_TEST_EXENAME"]))`
21+
else
22+
const test_exename = `$(joinpath(JULIA_HOME, Base.julia_exename()))`
23+
end
24+
1325
const node1_tests = String[]
1426
function move_to_node1(t)
1527
if t in tests
@@ -27,7 +39,7 @@ cd(dirname(@__FILE__)) do
2739
n = 1
2840
if net_on
2941
n = min(Sys.CPU_CORES, length(tests))
30-
n > 1 && addprocs(n; exeflags=`--check-bounds=yes --startup-file=no --depwarn=error`)
42+
n > 1 && addprocs(n; exename=test_exename, exeflags=test_exeflags)
3143
BLAS.set_num_threads(1)
3244
end
3345

@@ -50,7 +62,7 @@ cd(dirname(@__FILE__)) do
5062
if (isa(resp, Integer) && (resp > max_worker_rss)) || isa(resp, Exception)
5163
if n > 1
5264
rmprocs(p, waitfor=0.5)
53-
p = addprocs(1; exeflags=`--check-bounds=yes --startup-file=no --depwarn=error`)[1]
65+
p = addprocs(1; exename=test_exename, exeflags=test_exeflags)[1]
5466
remotecall_fetch(()->include("testdefs.jl"), p)
5567
else
5668
# single process testing, bail if mem limit reached, or, on an exception.

0 commit comments

Comments
 (0)