Skip to content

Commit

Permalink
add test for loading precompiled package with deps
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored and StefanKarpinski committed Jul 3, 2018
1 parent cfdad77 commit 5366be6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/TestPkg/Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[[Random]]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
6 changes: 6 additions & 0 deletions test/TestPkg/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name = "TestPkg"
uuid = "69145d58-7df6-11e8-0660-cf7622583916"


[deps]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
6 changes: 6 additions & 0 deletions test/TestPkg/src/TestPkg.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__precompile__()
module TestPkg

using Random

end
10 changes: 10 additions & 0 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,16 @@ end
# normalization of paths by include (#26424)
@test_throws ErrorException("could not open file $(joinpath(@__DIR__, "notarealfile.jl"))") include("./notarealfile.jl")

old_act_proj = Base.ACTIVE_PROJECT[]
pushfirst!(LOAD_PATH, "@")
try
Base.ACTIVE_PROJECT[] = joinpath(@__DIR__, "TestPkg")
@eval using TestPkg
finally
Base.ACTIVE_PROJECT[] = old_act_proj
popfirst!(LOAD_PATH)
end

## cleanup after tests ##

for env in keys(envs)
Expand Down

0 comments on commit 5366be6

Please sign in to comment.