Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,43 @@ end
runtests(MyModule, ARGS; init_code)
```

### Interactive use

Arguments can also be passed via the standard `Pkg.test` interface for interactive control. For example, here is how we could run the subset of tests that start with the testset name "MyTestsetA" in i) verbose mode, and ii) with default threading enabled:

```julia-repl
# In an environment where `MyPackage.jl` is available
julia --proj

julia> using Pkg

# No need to start a fresh session to change threading
julia> Pkg.test("MyModule"; test_args=`--verbose MyTestsetA`, julia_args=`--threads=auto`);
```
Alternatively, arguments can be passed directly from the command line with a shell alias like the one below:

```julia-repl
jltest --threads=auto -- --verbose MyTestsetA
```

<details><summary>Shell alias</summary>

```shell
function jltest {
julia=(julia)

# certain arguments (like those beginnning with a +) need to come first
if [[ $# -gt 0 && "$1" = +* ]]; then
julia+=("$1")
shift
fi

"${julia[@]}" --startup-file=no --project -e "using Pkg; Pkg.API.test(; test_args=ARGS)" "$@"
}
```

</details>

## Packages using ParallelTestRunner.jl

There are a few packages already using `ParallelTestRunner.jl` to parallelize their tests, you can look at their setups if you need inspiration to move your packages as well:
Expand Down