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
<ASSEMBLY|DIRECTORY> Path to the test assembly or application directory.
19
+
<path> Path to the test assembly or application directory.
18
20
19
21
Options:
20
-
-t|--target (REQUIRED) Path to the test runner application.
21
-
-a|--targetargs Arguments to be passed to the test runner.
22
-
-o|--output Output of the generated coverage report
23
-
-v|--verbosity Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed.
24
-
-f|--format Format of the generated coverage report. [default: json]
25
-
--threshold Exits with error if the coverage % is below value.
26
-
--threshold-type Coverage type to apply the threshold to.
27
-
--threshold-stat Coverage statistic used to enforce the threshold value. [default: Minimum]
28
-
--exclude Filter expressions to exclude specific modules and types.
29
-
--include Filter expressions to include only specific modules and types.
30
-
--exclude-by-file Glob patterns specifying source files to exclude.
31
-
--include-directory Include directories containing additional assemblies to be instrumented.
32
-
--exclude-by-attribute Attributes to exclude from code coverage.
33
-
--include-test-assembly Specifies whether to report code coverage of the test assembly.
34
-
--single-hit Specifies whether to limit code coverage hit reporting to a single hit for each location
35
-
--skipautoprops Neither track nor record auto-implemented properties.
36
-
--merge-with Path to existing coverage result to merge.
37
-
--use-source-link Specifies whether to use SourceLink URIs in place of file system paths.
38
-
--does-not-return-attribute Attributes that mark methods that do not return.
39
-
--exclude-assemblies-without-sources Specifies behaviour of heuristic to ignore assemblies with missing source documents.
40
-
--source-mapping-file Specifies the path to a SourceRootsMappings file.
41
-
--version Show version information
42
-
-?, -h, --help Show help and usage information
22
+
-t, --target <target> (REQUIRED) Path to the test runner application.
23
+
-a, --targetargs <targetargs> Arguments to be passed to the test runner.
24
+
-o, --output <output> Output of the generated coverage report
25
+
-v, --verbosity <Detailed|Minimal|Normal|Quiet>Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed. [default: Normal]
26
+
-f, --format <format> Format of the generated coverage report. [default: json]
27
+
--threshold <threshold> Exits with error if the coverage % is below value.
28
+
--threshold-type <branch|line|method>Coverage type to apply the threshold to. [default: line|branch|method]
29
+
--threshold-stat <Average|Minimum|Total> Coverage statistic used to enforce the threshold value. [default: Minimum]
30
+
--exclude <exclude> Filter expressions to exclude specific modules and types.
31
+
--include <include> Filter expressions to include only specific modules and types.
32
+
--exclude-by-file <exclude-by-file> Glob patterns specifying source files to exclude.
33
+
--include-directory <include-directory> Include directories containing additional assemblies to be instrumented.
34
+
--exclude-by-attribute <exclude-by-attribute> Attributes to exclude from code coverage.
35
+
--include-test-assembly Specifies whether to report code coverage of the test assembly.
36
+
--single-hit Specifies whether to limit code coverage hit reporting to a single hit for each location
37
+
--skipautoprops Neither track nor record auto-implemented properties.
38
+
--merge-with <merge-with> Path to existing coverage result to merge.
39
+
--use-source-link Specifies whether to use SourceLink URIs in place of file system paths.
40
+
--does-not-return-attribute <does-not-return-attribute>Attributes that mark methods that do not return
41
+
--exclude-assemblies-without-sources <exclude-assemblies-without-sources> Specifies behaviour of heuristic to ignore assemblies with missing source documents.
42
+
--source-mapping-file <source-mapping-file> Specifies the path to a SourceRootsMappings file.
43
+
--version Show version information
44
+
-?, -h, --help Show help and usage information
43
45
```
44
46
45
-
NB. For [multiple value] options you can either specify values multiple times i.e.
47
+
> [!NOTE]
48
+
> For [multiple value] options you can either specify values multiple times i.e.
@@ -74,10 +77,10 @@ _Note: The `--no-build` flag is specified so that the `/path/to/test-assembly.dl
74
77
75
78
Sometimes, there are tests that doesn't use regular unit test frameworks like xunit. You may find yourself in a situation where your tests are driven by a custom executable/script, which when run, could do anything from making API calls to driving Selenium.
76
79
77
-
As an example, suppose you have a folder `/integrationtest` which contains said executable (lets call it `runner.exe`) and everything it needs to successfully execute. You can use our tool to startup the executable and gather live coverage:
80
+
As an example, suppose you have a folder `/integrationtests` which contains said executable (lets call it `runner.exe`) and everything it needs to successfully execute. You can use our tool to startup the executable and gather live coverage:
Coverlet will first instrument all .NET assemblies within the `integrationtests` folder, after which it will execute `runner.exe`. Finally, at shutdown of your `runner.exe`, it will generate the coverage report. You can use all parameters available to customize the report generation. Coverage results will be generated once `runner.exe` exits. You can use all parameters available to customize the report generation.
@@ -106,7 +109,7 @@ The `--format` option can be specified multiple times to output multiple formats
By default, Coverlet will output the coverage results file(s) in the current working directory. The `--output` or `-o` options can be used to override this behaviour.
112
+
By default, Coverlet will output the coverage results file(s) in the current working directory. The `--output` or `-o` options can be used to override this behavior.
@@ -256,7 +259,7 @@ Coverlet has the ability to map the paths contained inside the debug sources int
256
259
257
260
The value for `--source-mapping-file` should be a file with each line being in the format `|path to map to=path in debug symbol`. For example to map the local checkout of a project `C:\git\coverlet` to project that was built with `<Deterministic>true</Deterministic>` which sets the sources to `/_/*` the following line must be in the mapping file.
Copy file name to clipboardExpand all lines: Documentation/MSBuildIntegration.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -189,7 +189,7 @@ Examples
189
189
*`/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`)
190
190
*`/p:Include="[coverlet.*.tests?]*"` => Includes all types in any assembly starting with `coverlet.` and ending with `.test` or `.tests` (the `?` makes the `s` optional)
191
191
192
-
Both `Exclude` and `Include` properties can be used together but `Exclude` takes precedence. You can specify multiple filter expressions by separting them with a comma (`,`).
192
+
Both `Exclude` and `Include` properties can be used together but `Exclude` takes precedence. You can specify multiple filter expressions by separating them with a comma (`,`).
193
193
194
194
You can also include coverage of the test assembly itself by setting `/p:IncludeTestAssembly` to `true`.
195
195
@@ -198,7 +198,7 @@ You can also include coverage of the test assembly itself by setting `/p:Include
198
198
Neither track nor record auto-implemented properties.
Copy file name to clipboardExpand all lines: Documentation/Roadmap.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This document describes the roadmap for coverlet showing priorities.
4
4
Maintain coverlet means like any other project two things, answer/resolve soon as possible new issues that are blocking our users an second improve product with new features and enhancements in different areas.
5
-
All coverlet issues are labeled and categorized to better support this activites.
5
+
All coverlet issues are labeled and categorized to better support this activities.
6
6
7
7
As soon as an issue is open is labeled with `untriaged` if not immediately solvable(we need to do some debugging/PoC to understand where is the issue).
8
8
After triage a final correct label is applied and will be taken into account depending on priority order.
Copy file name to clipboardExpand all lines: Documentation/VSTestIntegration.md
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
Since version `6.0.0`
6
6
7
7
* .NET Core >= 6.0
8
-
* .NET Framework >= 4.6.2
8
+
* .NET Framework >= 4.7.2
9
9
10
10
As explained in quick start section, to use collectors you need to run *SDK v6.0.100* (LTS) or newer and your project file must reference `coverlet.collector` and a minimum version of `Microsoft.NET.Test.Sdk`.
11
11
@@ -17,10 +17,10 @@ A sample project file looks like:
As you can see in case of `vstest` verb you **must** publish project before.
@@ -59,12 +59,13 @@ Attachments:
59
59
Test Run Successful.
60
60
Total tests: 1
61
61
Passed: 1
62
-
Total time: 2,5451 Seconds
62
+
Total time: 2.5451 Seconds
63
63
```
64
64
65
65
You can change the output directory using the standard `dotnet test` switch `--results-directory`
66
66
67
-
>*NB: By design VSTest platform will create your file under a random named folder(guid string) so if you need stable path to load file to some gui report system(i.e. coveralls, codecov, reportgenerator etc..) that doesn't support glob patterns or hierarchical search, you'll need to manually move resulting file to a predictable folder*
67
+
> [!NOTE]
68
+
>*By design VSTest platform will create your file under a random named folder(guid string) so if you need stable path to load file to some gui report system(i.e. coveralls, codecov, reportgenerator etc..) that doesn't support glob patterns or hierarchical search, you'll need to manually move resulting file to a predictable folder*
68
69
69
70
## Coverlet options supported by VSTest integration
0 commit comments