You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/src/docs/running.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ The default filter is available in the filterset DSL via the `default()` predica
93
93
94
94
By default, command-line arguments are always interpreted with respect to the default filter. For example, `cargo nextest -E 'all()'` will run all tests that match the default filter.
95
95
96
-
To override the default set on the command line, use `--ignore-default-filter`. For example, `cargo nextest -E 'all()' --ignore-default-filter` will run all tests, including those not in the default set.
96
+
To override the default filter on the command line, use `--ignore-default-filter`. For example, `cargo nextest -E 'all()' --ignore-default-filter` will run all tests, including those not in the default filter.
97
97
98
98
Because skipping some tests can be surprising, nextest prints the number of tests and binaries
99
99
skipped due to their presence in the default filter. For example:
@@ -110,40 +110,49 @@ skipped due to their presence in the default filter. For example:
The default set and `#[ignore]` can both be used to filter out some tests by default. However, there are key distinctions between the two:
115
+
The default filter and `#[ignore]` can both be used to filter out some tests by default. However, there are key distinctions between the two:
116
116
117
-
1. The default set is defined in nextest's configuration while ignored tests are annotated within Rust code.
118
-
2. Default sets can be separately configured per-profile. Ignored tests cannot.
119
-
3. Default sets are a nextest feature, while ignored tests also work with `cargo test`.
117
+
1. The default filter is defined in nextest's configuration while ignored tests are annotated within Rust code.
118
+
2. Default filters can be separately configured per-profile. Ignored tests are global to the repository.
119
+
3. Default filters are a nextest feature, while ignored tests also work with `cargo test`.
120
120
121
-
In practice, `#[ignore]` is often used for failing tests, while the default set is typically used to filter out tests that are very slow or require specific resources.
121
+
In practice, `#[ignore]` is often used for failing tests, while the default filter is typically used to filter out tests that are very slow or require specific resources.
122
122
123
123
### `--skip` and `--exact`
124
124
125
-
<!-- md:version 0.9.80 -->
125
+
<!-- md:version 0.9.81-->
126
126
127
-
Nextest accepts the `--skip` and `--exact` arguments after `--`, emulating the corresponding arguments accepted by `cargo test`. These arguments match test names.
127
+
Nextest accepts the `--skip` and `--exact` arguments after `--`, emulating the corresponding
128
+
arguments accepted by `cargo test`. The `--skip` and `--exact` arguments apply to test name filters
129
+
passed in after `--`.
128
130
129
131
For example, to run all tests matching the substring `test3`, but not including `skip1` or `skip2`:
130
132
131
133
```
132
134
cargo nextest run -- --skip skip1 --skip skip2 test3
133
135
```
134
136
135
-
To run all tests matching either exactly `test1`or the substring`test2`:
137
+
To run all tests matching exactly the names `test1`and`test2`:
136
138
137
139
```
138
-
cargo nextest run -- --exact test1 test2
140
+
cargo nextest run -- test1 test2 --exact
141
+
```
142
+
143
+
To run all tests except those matching exactly `slow_module::my_test`:
144
+
145
+
```
146
+
cargo nextest run -- --exact --skip slow_module::my_test
139
147
```
140
148
141
149
Alternatively, and in prior versions of nextest, use a [filterset](filtersets/index.md). Some examples:
0 commit comments