views:

41

answers:

1

I have a .DLL which contains .NET Runtime callable wrappers for COM/DCOM objects.

I have written a testing suite in C# in VS 2008 which calls our server functions which are in the abovementioned .DLL.

When code coverage was turned on and testing suite ran, code coverage test results did not yield any statistics and displayed zeroes for both Not Covered and Covered blocks.

Does anyone know why that would be the case?

Anyone knows how to get code coverage on .dll which are .net callable wrappers?

A: 

I don't know for sure how the code coverage engine you're using works, but they usually employ the profiling API + some reflection to figure out what managed code is executed.

I suspect RCWs are primarily native code, bridging between the managed objects and their native COM counterparts.

You could verify this by running .NET Reflector on the generated interop assemblies (which host the RCWs for your COM objects), and see how much managed code they actually contain.

Once you get past the interop border, however, all is lost, then you're no longer in managed territory. You'd need a native coverage tool to collect statistics from that side.

Kim Gräsman