Skip to content

Commit

Permalink
Merge pull request #18680 from JuliaLang/yyc/tests/params
Browse files Browse the repository at this point in the history
Allow specifying worker launcher and cmdline flags in the test
  • Loading branch information
yuyichao authored Oct 1, 2016
2 parents 3398c7e + 309f1f2 commit c4ebf7c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ else
typemax(Csize_t)
end

if haskey(ENV, "JULIA_TEST_EXEFLAGS")
const test_exeflags = `$(Base.shell_split(ENV["JULIA_TEST_EXEFLAGS"]))`
else
const test_exeflags = `--check-bounds=yes --startup-file=no --depwarn=error`
end

if haskey(ENV, "JULIA_TEST_EXENAME")
const test_exename = `$(Base.shell_split(ENV["JULIA_TEST_EXENAME"]))`
else
const test_exename = `$(joinpath(JULIA_HOME, Base.julia_exename()))`
end

const node1_tests = String[]
function move_to_node1(t)
if t in tests
Expand All @@ -27,7 +39,7 @@ cd(dirname(@__FILE__)) do
n = 1
if net_on
n = min(Sys.CPU_CORES, length(tests))
n > 1 && addprocs(n; exeflags=`--check-bounds=yes --startup-file=no --depwarn=error`)
n > 1 && addprocs(n; exename=test_exename, exeflags=test_exeflags)
BLAS.set_num_threads(1)
end

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

0 comments on commit c4ebf7c

Please sign in to comment.