From 9b89ce59f32ed10c912a982c6a0612374091e13c Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 12 Dec 2020 14:35:29 -0500 Subject: [PATCH 1/2] Use DEPOT_PATH instead of HOME in cmdlineargs test --- test/cmdlineargs.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 51b5a6bc77454..f839f5c7ccf5d 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -459,7 +459,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no` mkpath(joinpath(dir, ".julia", "config")) cp(testfile, joinpath(dir, ".julia", "config", "startup.jl")) - withenv((Sys.iswindows() ? "USERPROFILE" : "HOME") => dir) do + withenv("JULIA_DEPOT_PATH" => dir) do output = "[\"foo\", \"-bar\", \"--baz\"]" @test readchomp(`$exename $testfile foo -bar --baz`) == output @test readchomp(`$exename $testfile -- foo -bar --baz`) == output @@ -501,7 +501,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no` readsplit(cmd) = split(readchomp(cmd), '\n') - withenv((Sys.iswindows() ? "USERPROFILE" : "HOME") => dir) do + withenv("JULIA_DEPOT_PATH" => dir) do @test readsplit(`$exename $a`) == [a, a, b, a] @@ -610,9 +610,9 @@ let exename = Base.julia_cmd() # --startup-file let JL_OPTIONS_STARTUPFILE_ON = 1, JL_OPTIONS_STARTUPFILE_OFF = 2 - # `HOME=$tmpdir` to avoid errors in the user startup.jl, which hangs the tests. Issue #17642 + # `JULIA_DEPOT_PATH=$tmpdir` to avoid errors in the user startup.jl, which hangs the tests. Issue #17642 mktempdir() do tmpdir - withenv("HOME"=>tmpdir) do + withenv("JULIA_DEPOT_PATH"=>tmpdir) do @test parse(Int,readchomp(`$exename -E "Base.JLOptions().startupfile" --startup-file=yes`)) == JL_OPTIONS_STARTUPFILE_ON end end From 288fd6b8e30f2070f05767b376f1268efe132ebf Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 12 Dec 2020 16:13:20 -0500 Subject: [PATCH 2/2] fixup! Use DEPOT_PATH instead of HOME in cmdlineargs test --- test/cmdlineargs.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index f839f5c7ccf5d..46c21f9bd3346 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -456,8 +456,8 @@ let exename = `$(Base.julia_cmd()) --startup-file=no` println(ARGS) """) close(io) - mkpath(joinpath(dir, ".julia", "config")) - cp(testfile, joinpath(dir, ".julia", "config", "startup.jl")) + mkpath(joinpath(dir, "config")) + cp(testfile, joinpath(dir, "config", "startup.jl")) withenv("JULIA_DEPOT_PATH" => dir) do output = "[\"foo\", \"-bar\", \"--baz\"]" @@ -485,7 +485,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no` a = joinpath(dir, "a.jl") b = joinpath(dir, "b.jl") - c = joinpath(dir, ".julia", "config", "startup.jl") + c = joinpath(dir, "config", "startup.jl") write(a, """ println(@__FILE__)