# Parsing code coverage failed

**URL:** <https://community.sonarsource.com/t/parsing-code-coverage-failed/23764>\
**Category:** SonarQube Server / Community Build\
**Tags:** azuredevops-services, sonarqube, cfamily, sonarqube-cloud\
**Created:** [April 27, 2020, 9:22pm UTC](https://community.sonarsource.com/t/parsing-code-coverage-failed/23764 "2020-04-27T21:22:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dolphinm083](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dolphinm083/32/11232_2.png) [@dolphinm083](https://community.sonarsource.com/u/dolphinm083)\
**Post date:** [April 27, 2020, 9:22pm UTC](https://community.sonarsource.com/t/parsing-code-coverage-failed/23764/1 "2020-04-27T21:22:33Z")

</div>

Hello,

I’m trying to add the code coverage information for my c project (with c++ unit tests) to SonarCloud.

I have generated the coverage file with vstest.console, and used sonar.cfamily.vscoveragexml.reportsPath=\*\*/\*.coverage to specify it.

But when it comes to SonarCloud analysis I received an error:

Parsing D:\a\_temp\TestResults\9ff5b1c8-7b74-429f-a390-e9f6d4173b16\VssAdministrator\_WIN-A5JVBG8MS1P 2020-04-27 20\_32\_40.coverage

##[error]ERROR: Error during SonarQube Scanner execution  
##[error]java.lang.RuntimeException: com.ctc.wstx.exc.WstxIOException: Input length = 1

Thanks for any helps!

---

<div class="post-metadata">

**Author:** ![mpaladin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mpaladin/32/118_2.png) [@mpaladin](https://community.sonarsource.com/u/mpaladin)\
**Post date:** [April 28, 2020, 12:24pm UTC](https://community.sonarsource.com/t/parsing-code-coverage-failed/23764/2 "2020-04-28T12:24:13Z")

</div>

Hi @dolphinm083,

> [@dolphinm083](#):
>
> sonar.cfamily.vscoveragexml.reportsPath=\*\*/\*

> [@dolphinm083](#):
>
> Parsing D:\a\_temp\TestResults\9ff5b1c8-7b74-429f-a390-e9f6d4173b16\VssAdministrator\_WIN-A5JVBG8MS1P 2020-04-27 20\_32\_40.coverage

you shouldn’t feed `*.coverage` reports to the analyzer, it expects the xml report, see **C/C++/Objective-C** / **Coverage** / **Visual Studio Reports** section: [[Coverage & Test Data] Generate Reports for Apex, C/C++, Objective-C, Go, JS/TS and Python](https://community.sonarsource.com/t/coverage-test-data-generate-reports-for-apex-c-c-objective-c-go-js-ts-and-python/9687)

---

<div class="post-metadata">

**Author:** ![dolphinm083](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dolphinm083/32/11232_2.png) [@dolphinm083](https://community.sonarsource.com/u/dolphinm083)\
**Post date:** [May 1, 2020, 6:27pm UTC](https://community.sonarsource.com/t/parsing-code-coverage-failed/23764/3 "2020-05-01T18:27:59Z")

</div>

Hi Massimo,

Thanks for the information.

I have followed the instruction and used the codecoverage.exe visual studio test platform to convert the .coverage file to .xml file.

However, I found that the .xml file generated by the codecoverage.exe is empty. I’ve checked that the .coverage file generated by vstest.console is not empty. Do you have any idea about this?

Thanks

---

<div class="post-metadata">

**Author:** ![mpaladin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mpaladin/32/118_2.png) [@mpaladin](https://community.sonarsource.com/u/mpaladin)\
**Post date:** [May 4, 2020, 7:03am UTC](https://community.sonarsource.com/t/parsing-code-coverage-failed/23764/4 "2020-05-04T07:03:16Z")

</div>

Hi @dolphinm083,

> [@dolphinm083](#):
>
> I found that the .xml file generated by the codecoverage.exe is empty

I don’t know how to help you on that, are you getting any error from `codecoverage.exe`? Does it return with exit code 0?

---

<div class="post-metadata">

**Author:** ![dolphinm083](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/dolphinm083/32/11232_2.png) [@dolphinm083](https://community.sonarsource.com/u/dolphinm083)\
**Post date:** [May 4, 2020, 8:24am UTC](https://community.sonarsource.com/t/parsing-code-coverage-failed/23764/5 "2020-05-04T08:24:21Z")

</div>

> [@dolphinm083](#):
>
> I have followed the instruction and used the codecoverage.exe visual studio test platform to convert the .coverage file to .xml file.
> 
> However, I found that the .xml file generated by the codecoverage.exe is empty. I’ve checked that the .coverage file generated by vstest.console is not empty. Do you have any idea about this?

Hi Massimo,

Thanks for your reply and I didn’t receive any error from codecoverage.exe. It executed successfully and generated the xml but just empty.

---

<div class="post-metadata">

**Author:** ![mpaladin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mpaladin/32/118_2.png) [@mpaladin](https://community.sonarsource.com/u/mpaladin)\
**Post date:** [May 4, 2020, 8:43am UTC](https://community.sonarsource.com/t/parsing-code-coverage-failed/23764/6 "2020-05-04T08:43:32Z")

</div>

Hi @dolphinm083,

then perhaps there is no information in the .coverage file, I invite you to check that every step produce the correct data.
