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

Notification

Icon
Error

IL Injection
albertomonteiro
#1 Posted : Monday, May 28, 2012 3:22:22 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/28/2012(UTC)
Posts: 17
Location: Fortaleza, Ceara - Brasil

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
I was testing my "small" aop framework
https://github.com/AlbertoMonteiro/ThrowHelper
I injected IL after build, and I was trying to tests Instructions count with Mono.Cecil, but something was wrong, the instruction count was very higher than should be, so I dissabled it and saw that you inject some NCrunch calls, whats the purpose?
Remco
#2 Posted : Monday, May 28, 2012 3:31:03 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 862 times
Was thanked: 1176 time(s) in 1097 post(s)
Hi,

This is due to the instrumentation that NCrunch introduces in order to analyse code coverage at runtime. You can turn off instrumentation in your NCrunch project configuration, but note that by doing this you will lose code coverage for the entire project. My suggestion would be to use an "#if NCRUNCH" directive to introduce alternative behaviour for your test while it is running under NCrunch.


Cheers,

Remco
1 user thanked Remco for this useful post.
albertomonteiro on 5/28/2012(UTC)
albertomonteiro
#3 Posted : Monday, May 28, 2012 3:34:14 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/28/2012(UTC)
Posts: 17
Location: Fortaleza, Ceara - Brasil

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Yeah, I saw here:
https://gist.github.com/2817057
Thats very nice!!!
Btw, I love Mono.Cecil!!!

I changed the logic test.
Now I test the added instruction instead of testing the total number of instructions, thus, no need to worry about the code inserted by him
1 user thanked albertomonteiro for this useful post.
Remco on 5/28/2012(UTC)
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.025 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download