diff --git a/README.md b/README.md index 80cce59..0e923a8 100644 --- a/README.md +++ b/README.md @@ -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 +``` + +
Shell alias + +```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)" "$@" +} +``` + +
+ ## 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: