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.
18
18
19
19
Options:
20
20
-h|--help Show help information
@@ -23,21 +23,21 @@ Options:
23
23
-a|--targetargs Arguments to be passed to the test runner.
24
24
-o|--output Output of the generated coverage report
25
25
-v|--verbosity Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed.
26
-
-f|--format Format of the generated coverage report[multiple value].
26
+
-f|--format Format of the generated coverage report.
27
27
--threshold Exits with error if the coverage % is below value.
28
-
--threshold-type Coverage type to apply the threshold to[multiple value].
28
+
--threshold-type Coverage type to apply the threshold to.
29
29
--threshold-stat Coverage statistic used to enforce the threshold value.
30
-
--exclude Filter expressions to exclude specific modules and types[multiple value].
31
-
--include Filter expressions to include specific modules and types[multiple value].
32
-
--include-directoryInclude directories containing additional assemblies to be instrumented[multiple value].
33
-
--exclude-by-file Glob patterns specifying source files to exclude[multiple value].
34
-
--exclude-by-attribute Attributes to exclude from code coverage[multiple value].
30
+
--exclude Filter expressions to exclude specific modules and types.
31
+
--include Filter expressions to include only specific modules and types.
32
+
--exclude-by-file Glob patterns specifying source files to exclude.
33
+
--include-directoryInclude directories containing additional assemblies to be instrumented.
34
+
--exclude-by-attribute Attributes to exclude from code coverage.
35
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.
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.
37
38
--merge-with Path to existing coverage result to merge.
38
39
--use-source-link Specifies whether to use SourceLink URIs in place of file system paths.
39
-
--skipautoprops Neither track nor record auto-implemented properties.
40
-
--does-not-return-attribute Attributes that mark methods that do not return[multiple value].
40
+
--does-not-return-attribute Attributes that mark methods that do not return.
41
41
```
42
42
43
43
NB. For a [multiple value] options you have to specify values multiple times i.e.
@@ -60,6 +60,20 @@ After the above command is run, a `coverage.json` file containing the results wi
60
60
61
61
_Note: The `--no-build` flag is specified so that the `/path/to/test-assembly.dll` isn't rebuilt_
62
62
63
+
## Code Coverage for integration tests and end-to-end tests.
64
+
65
+
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.
66
+
67
+
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:
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.
74
+
75
+
_Note: Today, Coverlet relies on `AppDomain.CurrentDomain.ProcessExit` and `AppDomain.CurrentDomain.DomainUnload` to record hits to the filesystem, as a result, you need to ensure a graceful process shutdown. Forcefully, killing the process will result in an incomplete coverage report._
76
+
63
77
## Coverage Output
64
78
65
79
Coverlet can generate coverage results in multiple formats, which is specified using the `--format` or `-f` options. For example, the following command emits coverage results in the `opencover` format instead of `json`:
0 commit comments