Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wookay committed Jan 12, 2019
1 parent e1863c6 commit 0aba7e3
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ keywords = ["distributed", "test"]
license = "MIT"
desc = "some useful steps in tests"
authors = ["WooKyoung Noh <[email protected]>"]
version = "0.1.4-DEV"
version = "0.1.4"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,31 @@

# runtests

run test files with target directory and distributed run tests.

* [test/runtests.jl](https://github.com/wookay/Jive.jl/blob/master/test/runtests.jl)
run the test files from the specific directory.

```julia
using Jive # runtests
runtests(@__DIR__)
using Jive
runtests(@__DIR__, skip=[], node1=[])
```
![runtests.svg](https://wookay.github.io/docs/Jive.jl/assets/jive/runtests.svg)

for the `runtests.jl`, `ARGS` are used to filter the targets and to set the first one to test.

```
~/.julia/dev/Jive/test $ julia --color=yes runtests.jl jive/s jive/m start=3
1/5 jive/mockup/mockup.jl --
2/5 jive/mockup/warn-replacing-mock.jl --
3/5 jive/skip/skip-calls.jl
Pass 2 (0.26 seconds)
4/5 jive/skip/skip-functions.jl
Pass 4 (0.01 seconds)
5/5 jive/skip/skip.jl
Pass 4 (0.01 seconds)
✅ All 10 tests have been completed. (0.57 seconds)
```

in the above example, test files are matched for only have `jive/s` `jive/m` and jump up to the 3rd file.

### Examples

* run tests
Expand Down
25 changes: 20 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,31 @@

# runtests

run test files with target directory and distributed run tests.

* [test/runtests.jl](https://github.com/wookay/Jive.jl/blob/master/test/runtests.jl)
run the test files from the specific directory.

```julia
using Jive # runtests
runtests(@__DIR__)
using Jive
runtests(@__DIR__, skip=[], node1=[])
```
![runtests.svg](https://wookay.github.io/docs/Jive.jl/assets/jive/runtests.svg)

for the `runtests.jl`, `ARGS` are used to filter the targets and to set the first one to test.

```
~/.julia/dev/Jive/test $ julia --color=yes runtests.jl jive/s jive/m start=3
1/5 jive/mockup/mockup.jl --
2/5 jive/mockup/warn-replacing-mock.jl --
3/5 jive/skip/skip-calls.jl
Pass 2 (0.26 seconds)
4/5 jive/skip/skip-functions.jl
Pass 4 (0.01 seconds)
5/5 jive/skip/skip.jl
Pass 4 (0.01 seconds)
✅ All 10 tests have been completed. (0.57 seconds)
```

in the above example, test files are matched for only have `jive/s` `jive/m` and jump up to the 3rd file.

### Examples

* run tests
Expand Down
21 changes: 19 additions & 2 deletions docs/src/runtests.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,28 @@ Jive.runtests
```

```julia
using Jive # runtests
runtests(@__DIR__)
using Jive
runtests(@__DIR__, skip=[], node1=[])
```
![runtests.svg](https://wookay.github.io/docs/Jive.jl/assets/jive/runtests.svg)

for the `runtests.jl`, `ARGS` are used to filter the targets and to set the first one to test.

```
~/.julia/dev/Jive/test $ julia --color=yes runtests.jl jive/s jive/m start=3
1/5 jive/mockup/mockup.jl --
2/5 jive/mockup/warn-replacing-mock.jl --
3/5 jive/skip/skip-calls.jl
Pass 2 (0.26 seconds)
4/5 jive/skip/skip-functions.jl
Pass 4 (0.01 seconds)
5/5 jive/skip/skip.jl
Pass 4 (0.01 seconds)
✅ All 10 tests have been completed. (0.57 seconds)
```

in the above example, test files are matched for only have `jive/s` `jive/m` and jump up to the 3rd file.

### Examples

* run tests
Expand Down
10 changes: 6 additions & 4 deletions src/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ function path_separator_to_slash(subpath::String)
end

"""
runtests(dir::String; skip::Vector{String}=Vector{String}(), node1::Vector{String}=Vector{String}())
runtests(dir::String; skip::Union{Vector{Any},Vector{String}}=Vector{String}(), node1::Union{Vector{Any},Vector{String}}=Vector{String}())
run the test files from the specific directory.
* `dir`: the root directory to traverse.
* `skip`: files or directories to skip.
* `node1`: run on node 1 during for the distributed tests.
"""
function runtests(dir::String;
skip::Vector{String}=Vector{String}(),
node1::Vector{String}=Vector{String}())
function runtests(dir::String; skip::Union{Vector{Any},Vector{String}}=Vector{String}(), node1::Union{Vector{Any},Vector{String}}=Vector{String}())
all_tests = Vector{String}()
filters = []
start_idx = 1
Expand Down

0 comments on commit 0aba7e3

Please sign in to comment.