As far as I know, the NAnt only supports NUnit 1.1. The attribute based tests using [TestFixture] and [Text] were only introduced into NUnit 2.0. I haven't checked the NAnt CVS for a while - I'm still using 0.7.9.0 released back in June so I don't know if this has been changed.

 

I've worked around this by writing a wrapper program that shells out to NAnt - if the build was successful then I shell out to NUnit and run the tests.

 

Hope this helps,

Chris

 

-----Original Message-----
From: Mike Ratliff [mailto:[EMAIL PROTECTED]]
Sent:
15 October 2002 21:14
To: '[EMAIL PROTECTED]'
Subject: [Nant-users] Using NUnit Task

 

I am trying to get NAnt and NUnit working in together and experiencing a problem.

 

After sifting through the NAnt unit test source, it appears that people are using the concept of an AllTests class that examines a given assembly for types that inherit from TestCase. Is that the only way to get Unit tests to function under NAnt or will the test cases that I have using attributed based declaration  [TestFixture] and [Test] be able to work somehow?

 

I ask this because I have a series of tests that work perfectly when executed from the NUnit GUI or console, but when I try to run the NUnit task, I get:

 

BUILD FAILED

C:\Impact\impact.build(-1,-1): Error running unit test.

Object reference not set to an instance of an object.

Try `NAnt -help' for more information.

 

Any light on this error or if I am thinking about the problem from the correct angle would help.

 

Mike

 

 


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Reply via email to