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.
Build/Test Issues
Which Configuration doe NCrunch use for tests?
Started by ronjacobs on 7,489 views
Remco NCrunch Developer
#2370
06 Jul 2012 04:00 UTC
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
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
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
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 NCrunch Developer
#4570
27 Aug 2013 22:43 UTC
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
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
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
Thanks,
Mark Smith
Post a reply
Log in to reply.