Skip to content

Commit 2e10a27

Browse files
committed
Adapt tests to prevent removal of depots with in-use DLLs
1 parent 4390aaf commit 2e10a27

File tree

8 files changed

+283
-254
lines changed

8 files changed

+283
-254
lines changed

Compiler/test/special_loading.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# Only run when testing Base compiler
44
if Base.identify_package("Compiler") === nothing
5-
mktempdir() do dir
5+
include(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test", "tempdepot.jl"))
6+
mkdepottempdir() do dir
67
withenv("JULIA_DEPOT_PATH" => dir * (Sys.iswindows() ? ";" : ":"), "JULIA_LOAD_PATH" => nothing) do
78
cd(joinpath(@__DIR__, "CompilerLoadingTest")) do
89
@test success(pipeline(`$(Base.julia_cmd()[1]) --startup-file=no --project=. compiler_loading_test.jl`; stdout, stderr))

test/compileall.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
# We make it a separate test target here, so that it can run in parallel
33
# with the rest of the tests.
44

5+
include("tempdepot.jl")
6+
57
function precompile_test_harness(@nospecialize(f))
6-
load_path = mktempdir()
8+
load_path = mkdepottempdir()
79
try
810
pushfirst!(LOAD_PATH, load_path)
911
pushfirst!(DEPOT_PATH, load_path)

test/core.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const Bottom = Union{}
99
# For curmod_*
1010
include("testenv.jl")
1111

12+
include("tempdepot.jl")
13+
1214
## tests that `const` field declarations
1315

1416
# sanity tests that our built-in types are marked correctly for const fields
@@ -8443,7 +8445,7 @@ end
84438445

84448446
# precompilation
84458447
let load_path = mktempdir()
8446-
depot_path = mktempdir()
8448+
depot_path = mkdepottempdir()
84478449
try
84488450
pushfirst!(LOAD_PATH, load_path)
84498451
pushfirst!(DEPOT_PATH, depot_path)
@@ -8485,11 +8487,6 @@ let load_path = mktempdir()
84858487
filter!(()(load_path), LOAD_PATH)
84868488
filter!(()(depot_path), DEPOT_PATH)
84878489
rm(load_path, recursive=true, force=true)
8488-
try
8489-
rm(depot_path, force=true, recursive=true)
8490-
catch err
8491-
@show err
8492-
end
84938490
end
84948491
end
84958492

0 commit comments

Comments
 (0)