Skip to content

Commit b03d438

Browse files
authored
Add shell alias example + update testset name
1 parent 83f46cc commit b03d438

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ runtests(MyModule, ARGS; init_code)
7171

7272
### Interactive use
7373

74-
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:
74+
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:
7575

7676
```julia-repl
7777
# In an environment where `MyPackage.jl` is available
@@ -80,8 +80,31 @@ julia --proj
8080
julia> using Pkg
8181
8282
# No need to start a fresh session to change threading
83-
julia> Pkg.test("MyModule"; test_args=`--verbose MytestsetA`, julia_args=`--threads=auto`);
83+
julia> Pkg.test("MyModule"; test_args=`--verbose MyTestsetA`, julia_args=`--threads=auto`);
8484
```
85+
Alternatively, arguments can be passed directly from the command line with a shell alias like the one below:
86+
87+
```julia-repl
88+
jltest -- --verbose MyTestsetA
89+
```
90+
91+
<details><summary>Shell alias</summary>
92+
93+
```shell
94+
function jltest {
95+
julia=(julia)
96+
97+
# certain arguments (like those beginnning with a +) need to come first
98+
if [[ $# -gt 0 && "$1" = +* ]]; then
99+
julia+=("$1")
100+
shift
101+
fi
102+
103+
"${julia[@]}" --startup-file=no --threads=auto --project -e "using Pkg; Pkg.API.test(; test_args=ARGS)" "$@"
104+
}
105+
```
106+
107+
</details>
85108

86109
## Packages using ParallelTestRunner.jl
87110

0 commit comments

Comments
 (0)