Skip to content

Commit 799fb14

Browse files
committed
Precompile tests: Include name in depot path.
1 parent 339330c commit 799fb14

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

test/helpers/precompile.jl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
function precompile_test_harness(@nospecialize(f), testset::String)
2-
@testset "$testset" begin
3-
precompile_test_harness(f, true)
4-
end
5-
end
6-
function precompile_test_harness(@nospecialize(f), separate::Bool)
7-
load_path = mktempdir()
8-
load_cache_path = separate ? mktempdir() : load_path
1+
function precompile_test_harness(@nospecialize(f), name::String, separate::Bool=true)
2+
# XXX: adding the name because `mktempdir` is not deterministic under `Random.seed!(1)`
3+
load_path = joinpath(mktempdir(), name)
4+
load_cache_path = separate ? joinpath(mktempdir(), name) : load_path
5+
mkpath(load_path)
6+
mkpath(load_cache_path)
97
try
108
pushfirst!(LOAD_PATH, load_path)
119
pushfirst!(DEPOT_PATH, load_cache_path)

test/native/precompile.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
2-
3-
precompile_test_harness("Inference caching") do load_path
1+
precompile_test_harness("Native") do load_path
42
# Write out the Native test setup as a micro package
53
create_standalone(load_path, "TestCompiler", "native.jl")
64

test/ptx/precompile.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
precompile_test_harness("Inference caching") do load_path
1+
precompile_test_harness("PTX") do load_path
22
# Write out the PTX test helpers as a micro package
33
create_standalone(load_path, "TestCompiler", "ptx.jl")
44

0 commit comments

Comments
 (0)