Calling NUnit from NAnt Pragmatically
Often times when calling NUnit tests from NAnt scripts we use the nunit2 NAnt task. However, as NAnt version march on and NUnit versions do as well, one gets into assembly binding problems. You might using NUnit 2.2.6.0 and NAnt's compiled with 2.2.0.0. This can be solved with assembly binding redirects but, eh. Poo. This week on the XP Mailing List Charlie Poole said this:
If it's not too much trouble, revise your testing target to use <exec> rather than <nunit2> Since my copy of NUnit itself is continually evolving, I use <exec> for testing NUnit. You could also keep both targets in the script, since the task will most likely be upgraded soon. - Charlie Poole
I'd been avoiding having to call NUnitConsole.exe from the exec task just because it felt "icky." However, seeing that Charlie and he has +1 Charisma when attacking with NUnit, I am rethinking my objections. Then he added:
One bit of good news: we're working on creating a stable interface for tools
like Nant to use across NUnit versions. - Charlie Poole
Yay! I await it eagerly. While you're reading this, go get TestDriven.NET and start reading Jamie Cansdale's Blog. I'm surprised more people aren't impressed that his stuff supports the Express SKUs considering that Add-Ins aren't supported (explicitly locked out) with Express.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Comments are closed.
Besides, I'm I the only one that things that NUnit should finally start settling down on a core interface with a more "fixed" assembly version that doesn't change with every single release, no matter how small the changes? :)