Skip to content

Commit db0989f

Browse files
committed
Add test
1 parent a0f317e commit db0989f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/runtests.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ end
110110
rm(joinpath(new_depot, "compiled"); recursive=true, force=true)
111111
rm(joinpath(new_depot, "artifacts"); recursive=true, force=true)
112112
end # try
113+
test_load_path = mktempdir()
114+
test_depot_path = mktempdir()
113115
app_path(app_name) = abspath(app_compiled_dir, "bin", app_name * (Sys.iswindows() ? ".exe" : ""))
114-
app_output = read(`$(app_path("MyApp")) I get --args áéíóú --julia-args --threads=3 --check-bounds=yes -O1`, String)
116+
app_output = withenv("JULIA_DEPOT_PATH" => test_depot_path, "JULIA_LOAD_PATH" => test_load_path) do
117+
read(`$(app_path("MyApp")) I get --args áéíóú --julia-args --threads=3 --check-bounds=yes -O1`, String)
118+
end
115119

116120
# Check stdlib filtering
117121
if filter == true
@@ -140,6 +144,9 @@ end
140144
# Check app is precompiled in a normal process
141145
@test occursin("outputo: ok", app_output)
142146
@test occursin("myrand: ok", app_output)
147+
# Check env-provided depot and load paths are accepted
148+
@test occursin("DEPOT_PATH: [\"$test_depot_path", app_output)
149+
@test occursin("LOAD_PATH: [\"$test_load_path", app_output)
143150
# Check distributed
144151
@test occursin("n = 20000000", app_output)
145152
@test occursin("From worker 2:\t8", app_output)

0 commit comments

Comments
 (0)