Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Code Coverage not respecting ExcludeFromCodeCoverage
greba
#1 Posted : Wednesday, May 16, 2012 2:55:13 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/27/2012(UTC)
Posts: 13

Was thanked: 3 time(s) in 3 post(s)
Just installed 1.39b and tried NCrunch Metrics. It doesn't seem to be respecting the ExcludeFromCodeCoverage attribute.
Remco
#2 Posted : Wednesday, May 16, 2012 11:20:08 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
NCrunch uses a different mechanism for handling and excluding code coverage, so framework-specific attributes such as this one are not supported by the metrics view. If you wish to avoid aggregating metrics from certain areas of your source code, currently the only way to do this is to use the 'Exclude from metrics aggregation' option on the metrics view toolbar or via the context menu option.

Cheers,

Remco
greba
#3 Posted : Thursday, May 17, 2012 12:09:28 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/27/2012(UTC)
Posts: 13

Was thanked: 3 time(s) in 3 post(s)
Understood.
cshouts
#4 Posted : Tuesday, June 5, 2012 11:53:02 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/5/2012(UTC)
Posts: 4
Location: Milwaukee, WI

Thanks: 1 times
Is this the appropriate place to make a feature request? Support for ExcludeFromCodeCoverage would be beneficial.
Remco
#5 Posted : Tuesday, June 5, 2012 9:42:27 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks - many people are asking for this, so it looks like it will eventually be implemented :)
AGCOWAN
#6 Posted : Sunday, March 10, 2013 6:55:46 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/10/2013(UTC)
Posts: 1
Location: Australia

Bump. Any word on when this feature might be delivered?
Remco
#7 Posted : Sunday, March 10, 2013 8:08:19 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi,

I can't give any firm plans on when this will be added. It may be in the 1.45 release, although I recommend not holding out for it. For the time being, try using code coverage suppression instead.


Cheers,

Remco
Remco
#8 Posted : Saturday, March 30, 2013 10:19:41 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
For anyone interested, support for the ExcludeFromCodeCoverage attribute has been introduced with the newly released version of NCrunch (v1.45).
iamruss
#9 Posted : Wednesday, June 11, 2014 4:11:34 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/9/2014(UTC)
Posts: 1
Location: Russia

Hello, looks like ExcludeFromCodeCoverage attribute is supported only for AttributeTargets.Class. Attributing methods does not have any effect on NCrunch.
Remco
#10 Posted : Wednesday, June 11, 2014 10:44:02 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
NCrunch does support this attribute at method level, but be aware that methods containing the following will likely be unaffected by the attribute:

- Lambda expressions (contents of lambda will still be shown with code coverage)
- Yield return (iterator) methods
- ASync/Await methods

This is due to the inherent limitations of using an attribute to restrict code coverage data. This attribute doesn't get passed on by the compiler to any structures it generates to deal with the above situations. All code coverage tools that use the ExcludeFromCodeCoverage attribute encounter this problem, including MSTest (for which it was originally intended).

I recommend avoiding the use of this attribute. NCrunch's code coverage suppression comments leave less of a mark on the compiled code and are not subject to the above limitations.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.062 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download