Skip to content

Commit c4ebf7c

Browse files
authored
Merge pull request #18680 from JuliaLang/yyc/tests/params
Allow specifying worker launcher and cmdline flags in the test
2 parents 3398c7e + 309f1f2 commit c4ebf7c

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

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

0 commit comments

Comments
 (0)