Skip to content

Commit 864d445

Browse files
committed
Clarify filtering is on test files, not testsets
1 parent 9e72976 commit 864d445

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

docs/src/advanced.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,24 @@ Custom flags are stored in the `custom` field of the `ParsedArgs` object, with v
139139

140140
## Interactive use
141141

142-
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:
142+
Arguments can also be passed via the standard [`Pkg.test`](https://pkgdocs.julialang.org/v1/api/#Pkg.test) interface for interactive control.
143+
For example, here is how we could run the subset of test files that start with the name `test_cool_feature` in i) verbose mode, and ii) with a specific number of Julia threads enabled:
143144

145+
```bash
146+
# Start julia in an environment where `MyPackage.jl` is available
147+
julia --project
148+
```
144149
```julia-repl
145-
# In an environment where `MyPackage.jl` is available
146-
julia --proj
147-
148150
julia> using Pkg
149151
150152
# No need to start a fresh session to change threading
151-
julia> Pkg.test("MyModule"; test_args=`--verbose MyTestsetA`, julia_args=`--threads=auto`);
153+
julia> Pkg.test("MyModule"; test_args=`--verbose test_cool_feature`, julia_args=`--threads=auto`);
152154
```
155+
153156
Alternatively, arguments can be passed directly from the command line with a shell alias like the one below:
154157

155158
```julia-repl
156-
jltest --threads=auto -- --verbose MyTestsetA
159+
jltest --threads=auto -- --verbose test_cool_feature
157160
```
158161

159162
Shell alias:

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ julia --project test/runtests.jl [OPTIONS] [TESTS...]
6161
- `--verbose`: Print more detailed information during test execution (including start times for each test)
6262
- `--quickfail`: Stop the entire test run as soon as any test fails
6363
- `--jobs=N`: Use `N` worker processes (default: based on CPU threads and available memory)
64-
- `TESTS...`: Filter tests by name using prefix matching
64+
- `TESTS...`: Filter test files by name, matched using `startswith`
6565

6666
### Examples
6767

0 commit comments

Comments
 (0)