Skip to content

Commit

Permalink
fix using local projects when testing (#311)
Browse files Browse the repository at this point in the history
* fix using local projects when testing
  • Loading branch information
KristofferC committed May 30, 2018
1 parent b0a7c14 commit 4f0d960
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stdlib/Pkg/src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ function with_dependencies_loadable_at_toplevel(f, mainctx::Context, pkg::Packag
write_env(localctx, display_diff = false)
will_resolve && build_versions(localctx, new)
sep = Sys.iswindows() ? ';' : ':'
withenv(f, "JULIA_LOAD_PATH" => "$tmpdir$sep$(Types.stdlib_dir())")
withenv(f, "JULIA_LOAD_PATH" => "@$sep$tmpdir$sep$(Types.stdlib_dir())")
end
end

Expand Down
2 changes: 1 addition & 1 deletion stdlib/Pkg/src/generate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ function project(pkg::String, dir::String)
genfile(pkg, dir, "Project.toml") do io
print(io,
"""
authors = $authorstr
name = "$pkg"
uuid = "$(UUIDs.uuid1())"
version = "0.1.0"
authors = $authorstr
[deps]
"""
Expand Down
2 changes: 1 addition & 1 deletion stdlib/Pkg/test/test_packages/BigProject/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
author = "Some One"
authors = ["Some One <[email protected]>"]
name = "BigProject"
uuid = "da7e1942-2519-11e8-2822-f5508ce758f0"
version = "0.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
authors = ["Some One <[email protected]>"]
name = "SubModule"
uuid = "0d404dc8-25d6-11e8-300e-11c8e584fb95"
version = "0.1.0"
author = ["Some One"]

[deps]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
authors = ["Some One <[email protected]>"]
name = "SubModule2"
uuid = "2d3cad7e-26b9-11e8-3e8d-a543003d541d"
version = "0.1.0"
author = ["Some One"]

[deps]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[[Example]]
deps = ["Test"]
git-tree-sha1 = "8eb7b4d4ca487caade9ba3e85932e28ce6d6e1f8"
uuid = "7876af07-990d-54b4-ab0e-23690620f79a"
version = "0.5.1"

[[Test]]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
authors = ["Some One <[email protected]>"]
name = "LibFoo"
uuid = "22d9ad80-6275-11e8-2737-a9b3d0e63aa9"
version = "0.1.0"

[deps]
Example = "7876af07-990d-54b4-ab0e-23690620f79a"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module LibFoo

greet() = print("Hello World!")

end # module
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using LibFoo
using Test

@test 1 == 1
5 changes: 5 additions & 0 deletions stdlib/Pkg/test/test_packages/BigProject/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ using Example
using BigProject

@test BigProject.f() == 1

# #306 Pkg.jl
cd("LibFoo.jl") do
run(`$(Base.julia_cmd()) test/runtests.jl`)
end

0 comments on commit 4f0d960

Please sign in to comment.