Do excluded items still get analyzed?

Do excluded items still get analyzed?

Hello-

I've written a utility method that will return a string representation of the current call stack. Some unit tests of this method work great via NUnit, but when I run NUnit under NCover, there are two additional (unexpected) lines on the stack. I assume these are NCover's hooks.

Now I've already excluded everything that has the NUnit.Framework.TestFixture attribute applied to it, and I've verified that the report shows the unit tests themselves as being excluded. So my guess is that everything gets hooked and "excluded" classes / methods just don't get reported.

Are my assumptions correct here? If so, is there a mechanism for telling NCover not to even hook the items that are excluded from reporting?

Thanks much, Eric


RE: Do excluded items still get analyzed?

D'oh. I was looking at the diff in the wrong direction. This is even more confusing. It actually looks like running under NCover removes two lines from my call stack.

Specifically, here's what I have about 5 lines into the stack w/o NCover: at MethodBase.Invoke(System.Object obj, System.Object[] parameters) in :line 0\r\n at Reflect.InvokeMethod(System.Reflection.MethodInfo method, System.Object fixture, System.Object[] args) in :line 0\r\n at Reflect.InvokeMethod(System.Reflection.MethodInfo method, System.Object fixture) in :line 0\r\n

And with NCover, I only get: at Reflect.InvokeMethod(System.Reflection.MethodInfo method, System.Object fixture, System.Object[] args) in :line 0

Thanks again for your time.


RE: Do excluded items still get analyzed?

EricDAllen,

Your first assumption was correct. NCover instruments (hooks) everything, but excluded methods/classes don't factor into coverage percentags. A long time ago, NCover only instrumented the classes/methods that the profiled program actually used, but this led to inconsistent coverage percentages, since completly uncovered classes/methods wouldn't appear in the coverage data output.

Regards, Stephen Ward


RE: Do excluded items still get analyzed?

NB: there is no way to tell NCover to not instrument the excluded items


RE: Do excluded items still get analyzed?

Ok, thanks for the info. I've gotten around this by changing my verification method to succeed if it finds either the stack with the hooks or the one without. Seems to work smoothly enough.

Cheers, Eric