# 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](/sonarqube-cloud/analyzing-source-code/test-coverage/test-execution-parameters.md).

Test coverage reports are not generated by SonarQube Cloud itself. They must be generated by an external tool and then imported into SonarQube Cloud by specifying a parameter telling the scanner where to look for the report.

The data is then displayed in your SonarQube Cloud 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](/sonarqube-cloud/analyzing-source-code/analysis-parameters.md).

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**

Comma-delimited list of paths to coverage reports in the [Generic test data](/sonarqube-cloud/analyzing-source-code/test-coverage/generic-test-data.md) format.

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

**sonar.apex.coverage.reportPath**

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="#ccobjective-c" id="ccobjective-c"></a>

See [C / C++ / Objective-C test coverage](/sonarqube-cloud/analyzing-source-code/test-coverage/c-c-objective-c-test-coverage.md) for examples and details.

**sonar.cfamily.gcov.reportsPath**

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

**sonar.cfamily.llvm-cov.reportPath**

Path to the `llvm-cov` report files.

**sonar.cfamily.vscoveragexml.reportsPath**

Path to the code coverage report files generated by Visual Studio. 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**

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

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

See [.NET test coverage](/sonarqube-cloud/analyzing-source-code/test-coverage/dotnet-test-coverage.md) for examples and details.

**sonar.cs.vscoveragexml.reportsPaths**

Comma-delimited list of paths to the coverage reports produced by Visual Studio [Code Coverage](https://www.nuget.org/packages/Microsoft.CodeCoverage/17.7.2#readme-body-tab) or the `dotnet-coverage` tool. Wildcards are supported.

**sonar.cs.dotcover.reportsPaths**

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

**sonar.cs.opencover.reportsPaths**

Comma-delimited list of paths to the coverage reports produced by OpenCover or Coverlet. When working with Coverlet, choose the opencover output format.

## Dart <a href="#dart" id="dart"></a>

See [Dart test coverage](/sonarqube-cloud/analyzing-source-code/test-coverage/dart-test-coverage.md) for examples and details.

**sonar.dart.lcov.reportPaths**

Paths to [LCOV](https://github.com/linux-test-project/lcov) reports. Multiple paths may be comma-delimited or included via wildcards. Paths may be absolute or relative to the project root.

To produce this format, you need to activate coverage and run tests with it. If no path is provided, or no report coverage report is found at the provided paths, the default location is used: `coverage/lcov.info`

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

**sonar.flex.cobertura.reportPaths**

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**

See [Go test coverage](/sonarqube-cloud/analyzing-source-code/test-coverage/go-test-coverage.md) for examples and details.

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

## Groovy <a href="#groovy" id="groovy"></a>

**sonar.groovy.cobertura.reportPaths**

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

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

See [Java test coverage](/sonarqube-cloud/analyzing-source-code/test-coverage/java-test-coverage.md) for examples and details.

**sonar.coverage.jacoco.xmlReportPaths**

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

**sonar.jacoco.reportPaths**

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

## JavaScript/TypeScript <a href="#javascripttypescript" id="javascripttypescript"></a>

See [JavaScript / TypeScript test coverage](/sonarqube-cloud/analyzing-source-code/test-coverage/javascript-typescript-test-coverage.md) for examples and details.

**sonar.javascript.lcov.reportPaths**

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](/sonarqube-cloud/analyzing-source-code/test-coverage/php-test-coverage.md) for examples and details.

**sonar.php.coverage.reportPaths**

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](/sonarqube-cloud/analyzing-source-code/test-coverage/python-test-coverage.md) for examples and details.

**sonar.python.coverage.reportPaths**

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**

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.

## Rust <a href="#rust" id="rust"></a>

The Sonar Rust analyzer supports importing test coverage reports in the following formats:

* **Cobertura:** You can import Cobertura reports using the `sonar.rust.cobertura.reportPaths` property. This property accepts a comma-separated list of file paths to your Cobertura XML files.
* **LCOV:** You can import LCOV reports using the `sonar.rust.lcov.reportPaths` property. This property accepts a comma-separated list of file paths to your LCOV files.

If both `sonar.rust.lcov.reportPaths` and `sonar.rust.cobertura.reportPaths` are defined, the analyzer will consume both sets of reports sequentially. No merging or specific strategy is defined for handling conflicts or overlapping coverage data.

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

**sonar.scala.coverage.reportPaths**

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

## Swift with Xcode 13.3+ <a href="#swift-with-xcode" id="swift-with-xcode"></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](/sonarqube-cloud/analyzing-source-code/test-coverage/generic-test-data.md) format.

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

**sonar.swift.coverage.reportPaths**

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

## VB.NET <a href="#vbnet" id="vbnet"></a>

See [.NET test coverage](/sonarqube-cloud/analyzing-source-code/test-coverage/dotnet-test-coverage.md) for examples and details.

**sonar.vbnet.vscoveragexml.reportsPaths**

Comma-delimited list of paths to Visual Studio Code Coverage report files. Multiple paths may be comma-delimited or included via wildcards.

**sonar.vbnet.dotcover.reportsPaths**

Comma-delimited list of paths to dotCover coverage report files.

**sonar.vbnet.opencover.reportsPaths**

Comma-delimited list of paths to the coverage report files produced by OpenCover.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/test-coverage/test-coverage-parameters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
