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

Notification

Icon
Error

Which Configuration doe NCrunch use for tests?
ronjacobs
#1 Posted : Thursday, July 5, 2012 6:21:25 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/28/2012(UTC)
Posts: 4
Location: Redmond

I've got a project that has several configurations (debug and release). These configurations #define symbols that alter the behavior of the system.

Ideally, I'd like NCrunch to test each of the configurations (but that is probably not possible).

I assume that it is using the Debug configuration but I can't find any configuration that says so.
Remco
#2 Posted : Friday, July 6, 2012 4:00:52 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for posting!

You can control the build configuration used by NCrunch by adjusting the project-level NCrunch configuration option, 'Use build configuration'.

NCrunch will normally use the default build configuration specified in the .proj file if you don't supply one, so normally this will just be DEBUG. Note that you can set this configuration option while using multiple selection in the configuration dialog, so it's possible to set the option for all of your projects at once instead of one at a time.


Cheers,

REmco
Mark
#3 Posted : Tuesday, August 27, 2013 12:34:38 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 2/29/2012(UTC)
Posts: 36

Thanks: 13 times
Was thanked: 8 time(s) in 8 post(s)
Hey Remco,

I'd like to bump this concept but also raise the idea that defining arbitrary #define in the NCrunch configuration window would be a really nice feature.

IE. I have a #define that changes the behavior of the way the test is run. It is not associated with either the Configuration or Platform but affects NCrunch's ability to calculate code coverage. I don't want to tie this particular #define into a configuration but would love for NCrunch to make sure this value is defined whenever it runs.

Thanks,
Mark Smith
Remco
#4 Posted : Tuesday, August 27, 2013 10:43:09 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Mark -

Thanks for the suggestion. At the moment, it is possible to create custom defines that exist for NCrunch, although this does need to be done in the project files themselves. For example:

<DefineConstants Condition="$(NCrunch) == '1'">DEBUG;TRACE;MYDEFINITION</DefineConstants>

Adding this as a feature in the configuration window is a good idea, although it will probably need to be balanced with some UI changes in this area. The project configuration is rapidly exploding with new options, which isn't always great for keeping NCrunch simple to use :)


Cheers,

Remco
Mark
#5 Posted : Tuesday, August 27, 2013 11:36:44 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 2/29/2012(UTC)
Posts: 36

Thanks: 13 times
Was thanked: 8 time(s) in 8 post(s)
That would definitely work although my motivation for having as part of the config screen would be that NCrunch settings files don't require code review where as csproj files require the approval of others in the group who tend to hesitate to put utility specific functions into the project files. In general the more I can set in the NCrunch project file the better since it gives me a lot more flexibility without having to justify the changes. But I definitely see your point about the clutter on that screen, I just found more options in there yesterday.

Thanks,
Mark Smith
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.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download