microsoft / codecoverage

MIT License
80 stars 11 forks source link

Question - Should there be / will there be branch coverage for C++ projects ? #22

Open tonyhallett opened 2 years ago

tonyhallett commented 2 years ago

Using the nuget package https://www.nuget.org/packages/Microsoft.CodeCoverage/ and pointing into it with runsettings

    <TestAdaptersPaths>thepath\17.3.1\build\netstandard1.0</TestAdaptersPaths>
  <DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector friendlyName="Code Coverage" enabled="True">
jakubch1 commented 1 year ago

Currently we support only C# (cobertura format) and C++ branch coverage is not supported. We do support line and block coverage. Essentially, we split C++ binary into blocks [block is list of instructions without any jump etc.] and add probe for each block. So having 100% block coverage means you covered all your instructions. This is not telling you if you reach each instruction from all possible places (through jumps etc.) and if all conditions had both values.

We don't have plans to add this at the moment. Please create ticket also here: https://developercommunity.visualstudio.com/home If we see more people interested, we can consider adding this feature.