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

Notification

Icon
Error

Tests in a separate solution
bodie
#1 Posted : Tuesday, September 13, 2011 6:31:49 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/13/2011(UTC)
Posts: 7
Location: Kansas

Thanks: 2 times
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
#2 Posted : Tuesday, September 13, 2011 7:38:03 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
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.
bodie
#3 Posted : Tuesday, September 13, 2011 8:12:38 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/13/2011(UTC)
Posts: 7
Location: Kansas

Thanks: 2 times
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
#4 Posted : Tuesday, September 13, 2011 8:59:42 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
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.
bodie
#5 Posted : Tuesday, September 13, 2011 9:08:15 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/13/2011(UTC)
Posts: 7
Location: Kansas

Thanks: 2 times
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.
Remco
#6 Posted : Wednesday, September 14, 2011 6:21:29 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
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...lack-icon-in-MSTest.aspx
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 4.764 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download