Build/Test Issues

Incompatibility with Cudafy.Net

Started by rold2007 on 5,697 views

Hi,

I just encountered an issue while adding new tests to a class containing some "Cudafy" code. Running the code with NCrunch caused compilation problems for Cudafy. After a while I realized that Cudafy was compiling code where NCrunch had already added some instrumentation calls. Obvisousy, Cudafy doesn't know anything about EnsureStackSpaceExists(), MarkTestLineStart() and ExitMethod()...

I tried to work around the issue by adding the usual code coverage suppression comments but there was still some NCrunch's calls in my Cudafied code. Is this normal ?

I was wondering if there was anything I could do to prevent one method from being instrumented. I read here that the best would probably be to move this method to a separate assembly and disable instrumentation on that assembly.

One thing I would appreciate though is if you could rename the instrumentation calls to something like NCrunchEnsureStackSpaceExist() or another relevant name. This would have helped me understand where these were from as my first search of "EnsureStackSpaceExists" on Google returned 0 result and it is only by searching MarkTestLineStart later on that I found one post on this forum.

Cheers,

David
Hi David,

You're correct in your understanding that the right way to solve this problem is to move the code into an assembly with the instrumentation turned off. Even with code coverage suppression comments, NCrunch will still place some limited instrumentation into each method.

I see no reason why the methods being called by the instrumentation cannot be named more specifically. I'll make a note to look into this. Thanks for the feedback.


Cheers,

Remco

Post a reply

Log in to reply.