0

Well I am using opencover to generate the coverage report for the cpp code in html format. The report produced by the open cover seems to be like the amount of code covered by each test method as said in this post.

First screenshot:

Coverage Report

Second screenshot:

Report.

As seen in the second screenshot the coverage report is shown for the test project calctest.cpp but I want coverage report for the actual source file calc.cpp which is included in its header.

What I wanna to be shown is like as seen in calctest.cppthere two methods sum and mul in the calc.cpp and this two methods should be displayed in the first screenshot instead of the testmethod1, testmethod2,etc.

I think I made it clear or am I understanding incorrectly.

EDIT:

I think I am facing the same issue like this

UPDATE:

As said by Shaun Wilde in the link mentioned in the edit, on checking the .xml generated by opencover I couldn't find my source project name i.e CalcProject.lib in it, it only has the test project by name CalcTest.dll. And there are certain module tag with following statements

<Module skippedDueTo="Filter" hash="E9-A8-6A-CC-31-FF-25-91-E6-86-F2-D5-72-EE-77-7D-AB-36-F0-0B">
<FullName>C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll</FullName>
<ModuleName>mscorlib</ModuleName>
<Classes />
</Module>

The full .xml output cab be found here

Community
  • 1
  • 1
abu
  • 249
  • 2
  • 3
  • 11
  • Do you pass any filters to OpenCover? Can you provide the source code of a sample project? – Daniel Apr 30 '14 at 10:20
  • No filters bro! The source code is [here](http://pastebin.com/pZ2KLLrh) – abu Apr 30 '14 at 10:30
  • Is it possible to provide the full project. Otherwise I have to recreate it from scratch. – Daniel Apr 30 '14 at 10:39
  • Dropbox, or drive.google.com? – Daniel Apr 30 '14 at 10:44
  • Shared in [drive](https://drive.google.com/file/d/0B4-dj4WrB8pKV1o3djAyMENkZ0k/edit?usp=sharing) – abu Apr 30 '14 at 10:52
  • OpenCover requires that the corresponding PDB file is available. But CalcProject.pdb is not available. Can you configure the projects in a way that PDB is generated? – Daniel Apr 30 '14 at 11:33
  • Yeah I made the changes to make the CalcProject.pdb available in the same directory as CalcProject.lib, but same problem continues! – abu Apr 30 '14 at 12:36
  • Then I don't know. Perhaps you could open an issue here: https://github.com/opencover/opencover. Don't forget to supply the current project. That makes is easier to investigate. – Daniel Apr 30 '14 at 12:49
  • I wonder if this is a issue wouldn't others have faced the same or am I missing anything? Anyways I will do that. Thank you!!! – abu Apr 30 '14 at 12:54

0 Answers0