Skip to content

Commit

Permalink
Merge pull request #18 from wookay/test-specific-dependencies
Browse files Browse the repository at this point in the history
Test-specific dependencies in Julia 1.2 and above
  • Loading branch information
wookay authored Dec 28, 2019
2 parents 022f422 + b5a68f3 commit 35d85de
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ script:
- julia --color=yes -pauto -e 'using Jive; runtests(@__DIR__, skip=["Example", "errors", "jive/onlyonce/heavy.jl", "jive/__END__/included.jl", "jive/s"], node1=["jive/m"])'
- julia --color=yes -pauto -e 'using Jive; runtests(@__DIR__, skip=["jive/__END__/included.jl"], targets=["errors", "jive"], node1=["jive/m"])' || true

- cd Example/test
- julia --color=yes -e 'push!(Base.LOAD_PATH, "../../.."); push!(Base.LOAD_PATH, ".."); include("runtests.jl")' example
- cd
- julia --color=yes -e 'using Pkg; pkg"add Jive"'
- cd -
- julia --color=yes -e 'using Pkg; pkg"dev Example"'
- cd Example
- julia --color=yes --project=. test/runtests.jl example
- julia --color=yes -p2 --project=. test/runtests.jl example

after_success:
- if [[ "$TRAVIS_OS_NAME" == linux && "$TRAVIS_JULIA_VERSION" == 1.2 ]] ; then julia --project -e 'using Pkg;
Expand Down
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ keywords = ["distributed", "test"]
license = "MIT"
desc = "some useful steps in tests"
authors = ["WooKyoung Noh <[email protected]>"]
version = "0.2.2"
version = "0.2.3-DEV"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
FileWatching = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

Expand Down
6 changes: 6 additions & 0 deletions src/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ function distributed_run(dir::String, tests::Vector{String}, start_idx::Int, nod
local t0 = time_ns()
try
node1_tests = []
project = Base.JLOptions().project
if project != C_NULL
prj = unsafe_string(project)
@everywhere @eval(Main, using Pkg)
@everywhere @eval(Main, Pkg.activate($prj))
end
@everywhere @eval(Main, using Jive)
@sync begin
for worker in workers()
Expand Down
8 changes: 0 additions & 8 deletions test/Example/Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
name = "Example"
uuid = "7aa89a43-15c6-4fe4-aa5a-9f9705f170f6"

[extras]
Jive = "ba5e3d4b-8524-549f-bc71-e76ad9e9deed"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Jive", "Revise"]
4 changes: 4 additions & 0 deletions test/Example/test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Jive = "ba5e3d4b-8524-549f-bc71-e76ad9e9deed"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

0 comments on commit 35d85de

Please sign in to comment.