I work on a very large application (2+ million lines). The unit test projects are kept in a separate solution that does not also include the projects with the code under test. Is there a way to configure NCrunch to run in this environment?
Remco NCrunch Developer
#365
13 Sep 2011 19:38 UTC
This is an interesting arrangement ... Do you run your unit tests outside of Visual Studio?
The best suggestion I can offer would be to add a specialised solution that contains both the testing projects and the projects under test. The current design of NCrunch doesn't allow real-time operation with projects that are outside of your working solution. There are some rough plans for changes in this area but they are all still on the horizon I'm afraid.
The best suggestion I can offer would be to add a specialised solution that contains both the testing projects and the projects under test. The current design of NCrunch doesn't allow real-time operation with projects that are outside of your working solution. There are some rough plans for changes in this area but they are all still on the horizon I'm afraid.
We use MSTest and we run the tests inside of VS2010. However, there is a lot of "build, switch solutions, run" going on. I thought along the same lines as your suggestion and created a custom solution that included a project and the tests project that covers it. I got wierd results. When I selected "Enable NCrunch" from the NCrunch menu, VS went off into lala land for a while and then came back with nothing. No tests found, nothing in the queue, and no configuration available. Since I have NCrunch working on this machine in a test solution, I'm assuming that something in my solution's configuration is not playing nice with NCrunch?
Remco NCrunch Developer
#369
13 Sep 2011 20:59 UTC
When you created the new solution, did any of the projects contain project references to other projects that aren't in the solution? This tends to cause an interesting build situation that NCrunch can't handle at the moment. Still, I'd really like to have a look at the results of the engine when this happens to you - as it should at least be giving you some indication of what's happening under the hood. Would you mind using the 'Submit Bug Report' option in the NCrunch menu? This will send through a log file that I can take a look at.
Unfortunately, the code is in a protected enclave that has not access to the outside world, so I can't send anything from my dev box unless it can be persisted and transferred on physical media to my other network. Can I save the output you are after?
The good news is that, after creating the solution and building it, I closed and re-opened it and NCrunch was smooth like butter. I watch the queue as it worked through a few hundred unit tests in 2 mins 5 sec. It correctly displayed on the test side which passed and which failed, as well as some inconclusive lines (what does black mean on the test-side?).
But it seems to be confused about the code coverage. On the "code under test" side, my parameterless constructor shows as not covered, but I have a unit test covering it. Just for grins, I used "create unit tests" from the VS context menu and added another test covering the constructor, but NCrunch didn't seem to see it.
The good news is that, after creating the solution and building it, I closed and re-opened it and NCrunch was smooth like butter. I watch the queue as it worked through a few hundred unit tests in 2 mins 5 sec. It correctly displayed on the test side which passed and which failed, as well as some inconclusive lines (what does black mean on the test-side?).
But it seems to be confused about the code coverage. On the "code under test" side, my parameterless constructor shows as not covered, but I have a unit test covering it. Just for grins, I used "create unit tests" from the VS context menu and added another test covering the constructor, but NCrunch didn't seem to see it.
Remco NCrunch Developer
#373
14 Sep 2011 06:21 UTC
I'm glad it's started working ... a little concerned about how it didn't work the first time..
The black dots identify lines that are not covered by tests.
The issue you're seeing with the constructor may be because of a known problem where some IL configurations seem to prevent NCrunch from picking up a line as being covered, where actually it is - have a look at http://forum.ncrunch.net/yaf_postst65_Switch---Case-statements-appear-with-black-icon-in-MSTest.aspx
The black dots identify lines that are not covered by tests.
The issue you're seeing with the constructor may be because of a known problem where some IL configurations seem to prevent NCrunch from picking up a line as being covered, where actually it is - have a look at http://forum.ncrunch.net/yaf_postst65_Switch---Case-statements-appear-with-black-icon-in-MSTest.aspx
Post a reply
Log in to reply.