Andrew Stopford's Weblog

poobah

News

Articles

Family

Old Blogs

Creating a build system (NAnt,NUnit, Draco)

On a recent project I was tasked with creating a build system to replace building .net soloutions manually. The system must make use of VSS and must allow for integration with NUnit, NAnt a FxCop. I am still in the middle of this but what I have ended up with is something simlar to Brian's soloution.

  • Port VS soloution files to NAnt, after trying several tools (including NAnts own Slingshot app) I finally settled on using Gordon Weakliems soloution (XSLT and NAnt). I had to hack the resulting build files to work with 1.0 of .NET Framework and to not make the build directories absolute. This works a treat but I will have more hacking to do so that these changes are worked into Gordons soloution and I can run it all automaticlly.
  • Setup NAnt, this is easy enough, download, unzip, add to the system path. Done.
  • Setup a Continuous integration system, Hippo.NET and CruiseControl.NET and Draco.NET all refused to work at first. The key seemed to be with permissions, running the Draco service on an account with a higher set of permissions solved the problem. However Hippo.NET and CruiseControl.NET had further issues that I did'nt have time to resolved.

What is next is to tweak the system (some thinking out loud here :)

  • Script in the NUnit tests
  • Script in the FxCop tests, need to look at possible NAnt tasks for that

CruiseControl has a great system of combining NAnt/NUnit info into its reporting, not sure how I can do this with Draco but there are reporting systems to plug into NAnt for that.

Comments

beaudetious said:

Andrew,

I've got a question regarding how you plan to set up your Nunit scripts in this build system you are working on. I've been tasked with a similar situation using Subversion, Nant, Nunit and CruiseControl. Before all of this, we developers would put our unit tests in an inner class inside of the class we're testing in order to get to the private functions. We'd wrap this inner class in preprocessor directives so that we can keep them out of release builds. However, (and keep in mind that I haven't yet worked with Nant yet), I think I'll have to change this since I don't want to have to make a build via Nant just to test the unit tests, then make one for releases or debugs or whatever configuration I'm intersted in. I'd like to run the unit tests whenever I make a build no matter what configuration. How do you structure you unit tests? If its different than mine, how do you do blackbox testing on your private functions? Or should you? Call me confused!
# March 29, 2004 1:51 PM

Yves Lorphelin said:

beaudetious,
In all the projects I've been working on, we've never putted our unit test code into the code (with the notable exception of internal classes) but well in apart projects, or tried to test private methods.
What you really want to have unit test on is everything that has a public/protected access.

If you want to be sure wether all your private/internal member are hits when testing, you'll have to use a code coverage tool.
I know of two of them:
Ncover on http://workspaces.gotdotnet.com/ncover. I've been blogging about this lately and Ncover (yes the same name ) on http://ncover.sourceforge.net
The first one uses the profinling interface of the .Net runtime, the second one adds instrumentation code into your source files.
# April 1, 2004 2:51 PM

TrackBack said:

Regurgitated build stuff and more
# November 12, 2004 2:34 AM

TrackBack said:

# November 12, 2004 2:36 AM

Joe7Pak said:

It looks like Brian has set up his web site so that we may not see "Brian's soloution"

Darn.

# January 29, 2007 10:32 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)