question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lcov file is empty when using C# source generator

See original GitHub issue

I’ve been using Coverlet with Coveralls on my project for a long time. I don’t know when it started happening but now the report only includes methods from a dependent project.

I’m using the latest versions of xunit, Microsoft.NET.Test.Sdk, and coverlet.collector. I’m using net5. 0.

In the command line I’m typing: dotnet test ./NetFabric.Hyperlinq.UnitTests/NetFabric.Hyperlinq.UnitTests.csproj -f:net5.0 -c:Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings --diag:log.txt

The coverlet.runsettings file only has the following:

<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
  <DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector friendlyName="XPlat code coverage">
        <Configuration>
          <Format>lcov</Format>
          <!-- <Include>[NetFabric.Hyperlinq]*</Include> -->
          <!-- <Exclude>[NetFabric.Assertive]*</Exclude> -->
          <UseSourceLink>true</UseSourceLink>
        </Configuration>
      </DataCollector>
    </DataCollectors>
  </DataCollectionRunSettings>
</RunSettings>

In the generated logs I can see references to the classes of my main project but they keep not showing up in the coverage.info file.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22

github_iconTop GitHub Comments

2reactions
petlicommented, May 10, 2021

Glad it worked, @potatopeelings! Those files end up in the obj directory so they can be inspected to aid in tracking down issues with the generated code.

1reaction
MarcoRossignolicommented, Mar 30, 2021

Sorry for delay @aalmada super busy period, anyway should work also with vstest, I’ll keep this open for future investigation

Read more comments on GitHub >

github_iconTop Results From Across the Web

lcov file is empty when using C# source generator
I've been using Coverlet with Coveralls on my project for a long time. I don't know when it started happening but now the...
Read more >
lcov issue generating output file - code coverage
As a workaround, I modified the LCOV code such that if the header returned was empty, the source file name is assumed directly...
Read more >
LCOV Code Coverage
This short tutorial aims to describe how to generate lcov reports. ... This guide assumes you have the libreoffice source code in ......
Read more >
coverage is empty
Can you guys help a former Googler, I have been trying to generate coverage report with bazel and no matter what I do,...
Read more >
Measuring code coverage with S2E
You can get LCOV HTML reports when source code is available and the binary has suitable debug information. You can get basic block...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found