diff --git a/test/distributed_exec.jl b/test/distributed_exec.jl index 50c24d6..2345a6d 100644 --- a/test/distributed_exec.jl +++ b/test/distributed_exec.jl @@ -1924,12 +1924,17 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp """ cmd = setenv(`$(julia) -e $(failcode)`, env) @test success(cmd) + + # Hideous hack to double escape path separators on Windows so that it gets + # interpolated into the string (and then Cmd) correctly. + escaped_pkg_project = Sys.iswindows() ? replace(pkg_project, "\\" => "\\\\") : pkg_project + # Passing env or exeflags to addprocs(...) to override defaults envcode = """ using DistributedNext project = mktempdir() env = Dict( - "JULIA_LOAD_PATH" => string(LOAD_PATH[1], $(repr(pathsep)), "@stdlib", $(repr(pathsep)), "$(pkg_project)"), + "JULIA_LOAD_PATH" => string(LOAD_PATH[1], $(repr(pathsep)), "@stdlib", $(repr(pathsep)), "$(escaped_pkg_project)"), "JULIA_DEPOT_PATH" => DEPOT_PATH[1], "TMPDIR" => ENV["TMPDIR"], ) @@ -1939,7 +1944,7 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp """ * funcscode * """ for w in workers() @test remotecall_fetch(depot_path, w) == [DEPOT_PATH[1]] - @test remotecall_fetch(load_path, w) == [LOAD_PATH[1], "@stdlib", "$(pkg_project)"] + @test remotecall_fetch(load_path, w) == [LOAD_PATH[1], "@stdlib", "$(escaped_pkg_project)"] @test remotecall_fetch(active_project, w) == project @test remotecall_fetch(Base.active_project, w) == joinpath(project, "Project.toml") end