Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 3.67 average. Display Modes
  #1  
Old 11-17-2003, 05:14 AM
peter.major peter.major is online now
Registered User
 
Join Date: 11-17-2003
Posts: 2
NUnit

Hi all.

I have been tasked with evaluating automated build software with a view to implement daily (or more) builds into our process for the next version of the product (built in VS.Net).

Visual Build is refreshing compared to some of the other tools out there. The built-in tasks mean that I can set up a prototype build in a couple of hours, as compared to the days it took to figure out NAnt.

The ONLY thing that seems to be missing in regards to what we need is closer integration with NUnit - which IMHO is pretty much the defacto unit testing tool for .Net applications.

I guess I can fool around with "Run program" task and try to parse NUnit output to get some feedback... but it kind of defeats the whole purpose of why I like Visual Build - that I can get everything working in a couple of hours.

Maybe I'm missing the point... Can anyone advise me on their experience of using NUnit with Visual Build?

Kindest regards,
Pete
peter.major_AT_ivisgroup.com
Reply With Quote
  #2  
Old 11-17-2003, 08:44 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
Hey, we can't think of everything :^). NUnit takes only 1 to 3 command-line parameters (see http://nunit.org/commandLine.html), so it should be pretty simple to create a Run Program step for it. Console apps typically return a non-zero exitcode on failure (hopefully Nunit does too), so you shouldn't need to parse the output, since the Run Program action will fail on a non-zero exitcode.
Reply With Quote
  #3  
Old 11-17-2003, 09:50 AM
peter.major peter.major is online now
Registered User
 
Join Date: 11-17-2003
Posts: 2
Thanks for your prompt reply. A couple of things:

- You are indeed correct - NUnit does use return codes. And after exploring the product more I discoved how to send email notifications on failure with the console output... I would have prefered to have a task instead of having to figure it out myself, but hey that's life as a developer I guess.

- I realize that you can't make tasks for everything... there's a lot of products out there. Saying that however, I've used NUnit for the last companies that I've worked for. My experience is that it is pretty much THE testing tool for .Net development. Just seems a bit odd that there is no task for it. Saying that it can be done from the command line is a bit of a dull argument, after all I can use the command line to get the latest version of files from VSS rather than use your task if I really wanted to (but thank goodness I didn't have to)

- I'd love to hear from anyone who's used this product with NUnit and their experiences, maybe any tips and tricks they're using.

It seems like a great product though - a lot easier to use than NAnt! Keep up the good work.

Pete
Reply With Quote
  #4  
Old 06-10-2004, 12:16 PM
a_t_jackson a_t_jackson is online now
Registered User
 
Join Date: 03-11-2003
Location: Belfast, Northern Ireland
Posts: 23
I'm using NUNIT 2.1 and it very easy to integrate with VisualBuild. I have a "Run Program" action that calls the command line version of nunit, and passes in the path to the dll that it needs to test, something like:

C:\Program Files\NUnit V2.1\bin\nunit-console.exe "blah\bin\Release\mynunitproject.dll"

NUNIT returns zero as the exit code if tests pass, and non-zero otherwise, and the "Run Program" action automatically checks that.

In practice I have a have a single C# solution that contains a number of sub projects for a n-tier application. This solution contains nunit projects for each tier. I adopted the convention of naming the project nunitDataLayer.csproj, nunitBusinessLogic.csproj etc.

Developers typically work on one part of the code at a time and therefore only run one nunit project. Visual Build ensures all of nunit projects are alsoways re-run as part of the build process.
Reply With Quote
  #5  
Old 10-04-2004, 08:06 PM
JohnLiu JohnLiu is online now
Registered User
 
Join Date: 10-04-2004
Location: Sydney
Posts: 2
Lightbulb

Slight modification, I think this one works. Not 100% sure whether that's the right key.

Run Program Task

%REG_READ("HKLM\SOFTWARE\Microsoft\.NETFramework\A ssemblyFolders\NUnit.Framework\")%\nunit-console.exe %path_to_your%test.nunit
Reply With Quote
  #6  
Old 11-11-2004, 05:37 PM
dkallen dkallen is online now
Registered User
 
Join Date: 11-11-2004
Location: Minneapolis, MN
Posts: 3
NUnit step

Thanks John, your registry read is very convenient
and will save us time when we upgrade versions of NUnit.

Your technique worked perfectly.
I merely created a "Run Program" step
and pasted your HKEY thingy into it and replaced the argument with my test dll.

No further adjustments were needed to check error codes and such. It just works as expected.
Reply With Quote
  #7  
Old 11-11-2004, 08:11 PM
JohnLiu JohnLiu is online now
Registered User
 
Join Date: 10-04-2004
Location: Sydney
Posts: 2
Smile :)

we had the issue when some people in the office had NUnit 2.1 and others had 2.2

glad it helped.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 04:19 AM.


Copyright © 1999-2023 Kinook Software, Inc.