Reportgenerator: Knowing what tests executed a line

Created on 7 Feb 2019  路  7Comments  路  Source: danielpalme/ReportGenerator

I think it would be very useful to be able to know what tests executed a line of code, more than the count of times the line was executed. Would it be possible to add this feature?

It's possible to know that information by placing a breakpoint in the line that we want, then executing the tests and look at the Call Stack Window each time the debbuger hits the breakpoint, but that is far more work than just having the info in the report.

enhancement question

Most helpful comment

Please have a look at the latest version 4.0.13.
If you hover a source line, the test methods on the right are highlighted with green/yellow/red based on the coverage of the currently hovered line.

All 7 comments

That's already available depending on the coverage tool you are using.

For OpenCover use the coverbytest option
For altcover use the CallContext option

The coverage report will contain a "Coverage by test methods" section, which you can use to toggle between the methods.

See: Coverage

Wow, how nice!! I use OpenCover, just tried this and it's great! Sorry I didn't find that before, now I found the info in your blog and I see it's a feature since Nov. 4 2012...

In the other hand, don't you think it would be nice to be able to do the opossite, instead of clicking a test to see its coverage, clicking a line to see what tests execute it. So you if you are interested in a specific line, you don't have to go selecting all the tests one by one to see which ones execute that line.

I don't know if that's feasible to do, but I think it would be a nice feature.

It should be possible to add this feature.

I will consider adding this in the next release.

Please have a look at the latest version 4.0.13.
If you hover a source line, the test methods on the right are highlighted with green/yellow/red based on the coverage of the currently hovered line.

Great! Thanks for taking this feature into account!

I have a comment though, it happens that if you have more test methods in "Coverage by test methods" that what can fit the screen, and you want to see the highlighting for the non visible test methods, since the highlighting is produced by hovering the line, you loose the highlighting when going to scroll the list.

So to keep track of the all the test methods for a line you have to go back and forth between the line and the scroll bar.

IMHO, it would be better to click the line to select it, and leave the tests highlighted as long as the line is selected.

I changed the behavior.
Hovering is still possible, but if you click a line it gets selected and hovering is disabled.
New release: 4.0.13.1

Now that's excellent!
Thanks again

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gitlavir picture gitlavir  路  4Comments

stephentoub picture stephentoub  路  6Comments

yuichi-github picture yuichi-github  路  4Comments

ByteDecoder picture ByteDecoder  路  6Comments

nilfdev picture nilfdev  路  5Comments