Given that I create a C# NUnit Test Library called TryTesting
in MonoDevelop(MD) (3.0.4.6) on OSX, how should I run these tests from the terminal/command-line (so that I can add them to an automated build)?
I know that the general formula is:
nunit-console .../TryTesting/bin/Debug/TryTesting.dll
or
mono nunit-console.exe .../TryTesting/bin/Debug/TryTesting.dll
However, that alone is insufficient given the environment created when installing MonoDevelop.
I get the following output & error:
NUnit version 2.4.8
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Unix 12.1.0.0
CLR Version: 2.0.50727.1433 ( 2.10.9 (tarball Mon May 7 20:25:51 EDT 2012) )
Missing method .ctor in assembly /private/var/folders/r6/wqmfjz8142z0z9vcg_7k9y140000gn/T/nunit20/ShadowCopyCache/3688_634830482326369170/Tests/assembly/shadow/52c5f76b/6c545c94_3e91abff_00000001/TryTesting.dll, type NUnit.Framework.TestFixtureAttribute
Can't find custom attr constructor image: /private/var/folders/r6/wqmfjz8142z0z9vcg_7k9y140000gn/T/nunit20/ShadowCopyCache/3688_634830482326369170/Tests/assembly/shadow/52c5f76b/6c545c94_3e91abff_00000001/TryTesting.dll mtoken: 0x0a000003
Could not load file or assembly 'nunit.framework, Version=2.6.0.12051, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies.
Upon experimentation, it seems this issue is caused by mismatched nunit versions between /usr/bin and MD. If I download the latest NUnit binaries and replace the nunit.framework reference in my project to point at the downloaded copy, then I can get it to run by using the downloaded nunit-console.exe.
So, perhaps the question is:
- Should I delete the automatic references to nunit.framework and include my own distribution of NUnit in my source tree?
- or, Does MonoDevelop have a matching version of nunit-console that I should be calling?