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
You can specify the `--exclude` option multiple times to allow for multiple filter expressions.
177
+
Coverlet goes a step in the other direction by also letting you explicitly set what can be included using the `--include` option.
178
+
179
+
Examples
180
+
- `--include "[*]*"` => INcludes all types in all assemblies (nothing is instrumented)
181
+
- `--include "[coverlet.*]Coverlet.Core.Coverage"` => Includes the Coverage class in the `Coverlet.Core` namespace belonging to any assembly that matches `coverlet.*` (e.g `coverlet.core`)
182
+
- `--include "[coverlet.*.tests?]*"` => Includes all types in any assembly starting with `coverlet.` and ending with `.test` or `.tests` (the `?` makes the `s` optional)
183
+
184
+
Both `--exclude` and `--include` options can be used together but `--exclude` takes precedence. You can specify the `--exclude` and `--include` options multiple times to allow for multiple filter expressions.
177
185
178
186
### MSBuild
179
187
@@ -270,9 +278,16 @@ Examples
270
278
dotnet test /p:CollectCoverage=true /p:Exclude="[coverlet.*]Coverlet.Core.Coverage"
271
279
```
272
280
281
+
Coverlet goes a step in the other direction by also letting you explicitly set what can be included using the `Include` property.
282
+
283
+
Examples
284
+
- `/p:Include="[*]*"` => INcludes all types in all assemblies (nothing is instrumented)
285
+
- `/p:Include="[coverlet.*]Coverlet.Core.Coverage"` => Includes the Coverage class in the `Coverlet.Core` namespace belonging to any assembly that matches `coverlet.*` (e.g `coverlet.core`)
286
+
- `/p:Include="[coverlet.*.tests?]*"` => Includes all types in any assembly starting with `coverlet.` and ending with `.test` or `.tests` (the `?` makes the `s` optional)
287
+
288
+
Both `Exclude` and `Include` properties can be used together but `Exclude` takes precedence.
273
289
274
-
You can specify multiple filter expressions by separting them with a comma (`,`). If you specify multiple filters, then [you'll have to escape the surrounding quotes](https://github.com/Microsoft/msbuild/issues/2999#issuecomment-366078677) like this:
275
-
`/p:Exclude=\"[coverlet.*]*,[*]Coverlet.Core*\"`.
290
+
You can specify multiple filter expressions by separting them with a comma (`,`). If you specify multiple filters, then [you'll have to escape the surrounding quotes](https://github.com/Microsoft/msbuild/issues/2999#issuecomment-366078677) like this: `/p:Exclude=\"[coverlet.*]*,[*]Coverlet.Core*\"` or `/p:Include=\"[coverlet.*]*,[*]Coverlet.Core*\"`.
276
291
277
292
### Cake Addin
278
293
If you're using [Cake Build](https://cakebuild.net) for your build script you can use the [Cake.Coverlet](https://github.com/Romanx/Cake.Coverlet) addin to provide you extensions to dotnet test for passing coverlet arguments in a strongly typed manner.
0 commit comments