# Test coverage parameters

*Test coverage reports* describe the percentage of your code that has been tested by your test suite during a build.

This differs from *test execution reports*, which describe which tests within your test suite have been run during a build. For details, see [test-execution-parameters](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/test-execution-parameters "mention").

Test coverage reports are not generated by SonarQube itself. They must be generated by an external tool and then imported into SonarQube by specifying a parameter telling the scanner where to look for the report. The data is then displayed in your SonarQube analysis.

Below, you will find language- and tool-specific analysis parameters for importing test coverage reports.

For information on analysis parameters in general, see [analysis-parameters](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/analysis-parameters "mention").

Unless otherwise specified, these properties require values that are relative to the project root. Some properties support the following wildcards in paths. The remarks for properties that support wildcards will mention this fact. If wildcards are not noted for a given property, then they are not supported for that property.

|            |                           |
| ---------- | ------------------------- |
| **Symbol** | **Meaning**               |
| `?`        | a single character        |
| `*`        | any number of characters  |
| `**`       | any number of directories |

### All languages <a href="#all-languages" id="all-languages"></a>

#### sonar.coverageReportPaths <a href="#sonarcoveragereportpaths" id="sonarcoveragereportpaths"></a>

Comma-delimited list of paths to coverage reports in the [generic-test-data](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/generic-test-data "mention") format.

### Apex <a href="#apex" id="apex"></a>

#### sonar.apex.coverage.reportPath <a href="#sonarapexcoveragereportpath" id="sonarapexcoveragereportpath"></a>

Path to the `test-result-codecoverage.json` report file generated by the [`apex:test:run`](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_apex.htm?search_text=apex%20test#cli_reference_test_run) command of the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). Note, you must have a [Salesforce DX project](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_workspace_setup.htm) set up and linked to your organization.

### C/C++/Objective-C <a href="#cfamily" id="cfamily"></a>

See [c-family-test-coverage](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/c-family-test-coverage "mention") for examples and details.

#### sonar.cfamily.gcov.reportsPath <a href="#sonarcfamilygcovreportspath" id="sonarcfamilygcovreportspath"></a>

Path to the directory containing native `*.gcov` reports (not the XML reports generated by `gcovr`).

#### sonar.cfamily.llvm-cov.reportPath <a href="#sonarcfamilyllvmcovreportpath" id="sonarcfamilyllvmcovreportpath"></a>

Path to the `llvm-cov` report.

#### sonar.cfamily.vscoveragexml.reportsPath <a href="#sonarcfamilyvscoveragexmlreportspath" id="sonarcfamilyvscoveragexmlreportspath"></a>

Path to the Visual Studio Code Coverage report. The path may be absolute or relative to the solution directory. Path wildcards (see above) are supported. Note that the `.coverage` report format must be converted to `.coveragexml` format using the tool `CodeCoverage.exe` tool in order to be imported.

#### sonar.cfamily.bullseye.reportPath <a href="#sonarcfamilybullseyereportpath" id="sonarcfamilybullseyereportpath"></a>

Path to the report from Bullseye, version >= 8.9.63 (use the [`covxml`](http://www.bullseye.com/help/ref-covxml.html) tool)

### C# <a href="#csharp" id="csharp"></a>

See [dotnet-test-coverage](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/dotnet-test-coverage "mention") for examples and details.

#### sonar.cs.vscoveragexml.reportsPaths <a href="#sonarcsvscoveragexmlreportspaths" id="sonarcsvscoveragexmlreportspaths"></a>

Comma-delimited list of paths to the coverage reports produced by Visual Studio Code Coverage or the `dotnet-coverage` tool. Wildcards are supported.

#### sonar.cs.dotcover.reportsPaths <a href="#sonarcsdotcoverreportspaths" id="sonarcsdotcoverreportspaths"></a>

Comma-delimited list of paths to the dotCover coverage reports.

#### sonar.cs.opencover.reportsPaths <a href="#sonarcsopencoverreportspaths" id="sonarcsopencoverreportspaths"></a>

Comma-delimited list of paths to the OpenCover or Coverlet coverage reports.

### Flex <a href="#flex" id="flex"></a>

#### sonar.flex.cobertura.reportPaths <a href="#sonarflexcoberturareportpaths" id="sonarflexcoberturareportpaths"></a>

Path to the Cobertura XML reports. Multiple paths may be comma-delimited. May be absolute or relative to the project base directory.

### Go <a href="#go" id="go"></a>

#### sonar.go.coverage.reportPaths <a href="#sonargocoveragereportpaths" id="sonargocoveragereportpaths"></a>

Comma-delimited list of paths to coverage report files. Wildcards are supported.

### Java/Kotlin/Scala/JVM <a href="#java" id="java"></a>

See [java-test-coverage](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/java-test-coverage "mention") for examples and details.

#### sonar.coverage.jacoco.xmlReportPaths <a href="#sonarcoveragejacocoxmlreportpaths" id="sonarcoveragejacocoxmlreportpaths"></a>

Comma-delimited list of paths to JaCoCo XML coverage reports. Wildcards are supported.

#### sonar.jacoco.reportPaths <a href="#sonarjacocoreportpaths" id="sonarjacocoreportpaths"></a>

Deprecated. Use `sonar.coverage.jacoco.xmlReportPaths`.

### JavaScript/TypeScript <a href="#javascript-typescript" id="javascript-typescript"></a>

See [javascript-typescript-test-coverage](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/javascript-typescript-test-coverage "mention") for examples and details.

#### sonar.javascript.lcov.reportPaths <a href="#sonarjavascriptlcovreportpaths" id="sonarjavascriptlcovreportpaths"></a>

Comma-delimited list of paths to LCOV coverage report files. Paths may be absolute or relative to the project root.

### PHP <a href="#php" id="php"></a>

See [php-test-coverage](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/php-test-coverage "mention") for examples and details.

#### sonar.php.coverage.reportPaths <a href="#sonarphpcoveragereportpaths" id="sonarphpcoveragereportpaths"></a>

Comma-delimited list of paths to Clover XML-format coverage report files. Paths may be absolute or relative to the project root.

### Python <a href="#python" id="python"></a>

See [python-test-coverage](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/python-test-coverage "mention") for examples and details.

#### sonar.python.coverage.reportPaths <a href="#sonarpythoncoveragereportpaths" id="sonarpythoncoveragereportpaths"></a>

Comma-delimited list of paths to coverage reports in the Cobertura XML format. Wildcards are supported. Leave unset to use the default, `coverage-reports/*coverage-*.xml`.

### Ruby <a href="#ruby" id="ruby"></a>

#### sonar.ruby.coverage.reportPaths <a href="#sonarrubycoveragereportpaths" id="sonarrubycoveragereportpaths"></a>

Comma-delimited list of paths to SimpleCov report files generated with the [JSON formatter](https://github.com/simplecov-ruby/simplecov#json-formatter) (available from SimpleCov 0.20). For SimpleCov versions before 0.18, you can provide `.resultset.json` report files (though we recommend updating to 0.20 and using the JSON formatter). Paths may be absolute or relative to the project root.

When using the `simplecov_json_formatter` from simplecov >= v0.20, add\
`-D sonar.ruby.coverage.reportPaths=coverage/coverage.json \` to your SonarScanner code.

### Scala <a href="#scala" id="scala"></a>

#### sonar.scala.coverage.reportPaths <a href="#sonarscalacoveragereportpaths" id="sonarscalacoveragereportpaths"></a>

Comma-delimited list of paths to `scoverage.xml` report files generated by Scoverage.

### Swift with Xcode 13.3+ <a href="#swift-xcode-13-3" id="swift-xcode-13-3"></a>

You can use the [xccov-to-sonarqube-generic.sh](https://github.com/SonarSource/sonar-scanning-examples/blob/master/swift-coverage/swift-coverage-example/xccov-to-sonarqube-generic.sh) script from the [sonar-scanning-examples/swift-coverage](https://github.com/SonarSource/sonar-scanning-examples/tree/master/swift-coverage) project to convert output from Xcode 13.3’s `xccov` tool to the [generic-test-data](https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/test-coverage/generic-test-data "mention") format.

See the [community guide](https://community.sonarsource.com/t/coverage-test-data-generate-reports-for-swift/9700) for help with importing your coverage or test data.

### Swift with Xcode 7-13.2 <a href="#swift-xcode-13-2" id="swift-xcode-13-2"></a>

#### sonar.swift.coverage.reportPaths <a href="#sonarswiftcoveragereportpaths" id="sonarswiftcoveragereportpaths"></a>

Comma-delimited list of paths to the reports generated by `llvm-cov show`. A path may be absolute or relative to the project root.

### VB.NET <a href="#vb-dotnet" id="vb-dotnet"></a>

See [.NET test coverage](https://app.gitbook.com/s/Bmptmznn7RpPe5u7vdup/analyzing-source-code/test-coverage/dotnet-test-coverage "mention") for examples and details.

#### sonar.vbnet.vscoveragexml.reportsPaths <a href="#sonarvbnetvscoveragexmlreportspaths" id="sonarvbnetvscoveragexmlreportspaths"></a>

Comma-delimited list of paths to Visual Studio Code Coverage reports. Wildcards are supported.

#### sonar.vbnet.dotcover.reportsPaths <a href="#sonarvbnetdotcoverreportspaths" id="sonarvbnetdotcoverreportspaths"></a>

Comma-delimited list of paths to dotCover coverage reports.

#### sonar.vbnet.opencover.reportsPaths <a href="#sonarvbnetopencoverreportspaths" id="sonarvbnetopencoverreportspaths"></a>

Comma-delimited list of paths to OpenCover coverage reports.
