Skip to content

Commit

Permalink
Remote include tests use temp files now
Browse files Browse the repository at this point in the history
  • Loading branch information
Gollor committed May 13, 2017
1 parent 6a4acc0 commit 93cf6d9
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1571,35 +1571,43 @@ end

@test let
# creates a new worker in the same folder and tries to include file on both procs
working_directory = pwd()
cd(tempdir())
try
touch("temp.jl")
tmp_file = relpath(mktemp()[1])
proc = addprocs_with_testenv(1)
include("temp.jl")
remotecall_fetch(include, proc[1], "temp.jl")
include(tmp_file)
remotecall_fetch(include, proc[1], tmp_file)
rmprocs(proc)
rm("temp.jl")
rm(tmp_file)
cd(working_directory)
return true
catch e
try rm("temp.jl") end
try rm(tmp_file) end
cd(working_directory)
return false
end
end == true

@test let
# creates a new worker in the different folder and tries to include file on both procs
working_directory = pwd()
cd(tempdir())
try
mkdir("temp_folder")
touch("temp.jl")
proc = addprocs_with_testenv(1, dir="temp_folder")
include("temp.jl")
remotecall_fetch(include, proc[1], "temp.jl")
tmp_file = relpath(mktemp()[1])
tmp_dir = relpath(mktempdir())
proc = addprocs_with_testenv(1, dir=tmp_dir)
include(tmp_file)
remotecall_fetch(include, proc[1], tmp_file)
rmprocs(proc)
rm("temp_folder")
rm("temp.jl")
rm(tmp_dir)
rm(tmp_file)
cd(working_directory)
return true
catch e
try rm("temp_folder") end
try rm("temp.jl") end
try rm(tmp_dir) end
try rm(tmp_file) end
cd(working_directory)
return false
end
end == true
Expand Down

0 comments on commit 93cf6d9

Please sign in to comment.