From 0c322fa95ee5dfa9d08d10aa5a6bc7c2d5b9b31a Mon Sep 17 00:00:00 2001 From: Ian Weaver Date: Tue, 21 Oct 2025 17:18:26 -0700 Subject: [PATCH 1/4] add interactive test usage example Added instructions for interactive test execution using Pkg. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 30b6137..386b1a5 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,20 @@ 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 might 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 the root directory of `MyPackage.jl` +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`); +``` + ## 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: From 83f46cc076db25bb853107dd85c4697b000e3359 Mon Sep 17 00:00:00 2001 From: Ian Weaver Date: Tue, 21 Oct 2025 20:16:17 -0700 Subject: [PATCH 2/4] relax --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 386b1a5..dd26ddb 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ runtests(MyModule, ARGS; init_code) Arguments can also be passed via the standard `Pkg.test` interface for interactive control. For example, here is how we might 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 the root directory of `MyPackage.jl` +# In an environment where `MyPackage.jl` is available julia --proj julia> using Pkg From b03d43878b91f02209a3bd2c691f9bb9afc6d3a3 Mon Sep 17 00:00:00 2001 From: Ian Weaver Date: Wed, 22 Oct 2025 02:29:10 -0700 Subject: [PATCH 3/4] Add shell alias example + update testset name --- README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd26ddb..7cb36e0 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ 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 might run the subset of tests that start with the testset name "MytestsetA" in i) verbose mode, and ii) with default threading enabled: +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 @@ -80,8 +80,31 @@ 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`); +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 -- --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 --threads=auto --project -e "using Pkg; Pkg.API.test(; test_args=ARGS)" "$@" +} +``` + +
## Packages using ParallelTestRunner.jl From 7eea058a6f26913d88a0a0292648a0694d916e17 Mon Sep 17 00:00:00 2001 From: Ian Weaver Date: Wed, 22 Oct 2025 02:55:17 -0700 Subject: [PATCH 4/4] move julia_args from alias to command line --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7cb36e0..bac8d8b 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ julia> Pkg.test("MyModule"; test_args=`--verbose MyTestsetA`, julia_args=`--thre Alternatively, arguments can be passed directly from the command line with a shell alias like the one below: ```julia-repl -jltest -- --verbose MyTestsetA +jltest --threads=auto -- --verbose MyTestsetA ```
Shell alias @@ -100,7 +100,7 @@ function jltest { shift fi - "${julia[@]}" --startup-file=no --threads=auto --project -e "using Pkg; Pkg.API.test(; test_args=ARGS)" "$@" + "${julia[@]}" --startup-file=no --project -e "using Pkg; Pkg.API.test(; test_args=ARGS)" "$@" } ```