[Pkg-mono-devel] NUnit, NAnt, and C# 2.0 features

Edward Cho zerokarmaleft at gmail.com
Mon Mar 6 08:10:11 UTC 2006


A bit of prologue:

I've been working on a class library and writing unit tests along the
way.  Last week, I decided to experiment with generics and anonymous
methods, but was pleasantly surprised to find that NUnit can't load
assemblies with generics.  Attached is a simplified test case compiled
using gmcs.  Here's the resulting output from the test runner:

nunit-console TestGenerics.dll
[snip]
OS Version: Unix 2.6.12.10    Mono Version: 1.1.4322.573

** (/usr/lib/nunit/nunit-console.exe:13547): WARNING **: The class
System.Collections.Generic.List`1 could not be loaded, used in
/home/zerokarmaleft/projects/gmcsunittests/TestGenerics.dll (token
0x01000002)

** (/usr/lib/nunit/nunit-console.exe:13547): WARNING **: Finalization
of domain domain-TestGenerics.dll timed out.

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance
of an object

Server stack trace:
[nothing here]

Exception rethrown at [0]:
in (wrapper xdomain-invoke) NUnit.Core.RemoteTestRunner:Load (string)
in <0x000a8> NUnit.Util.TestDomain:Load (System.String
assemblyFileName, System.String testFixture)

Obviously, NUnit cannot support generics b/c it was not built against
the 2.0 classlibs.  And b/c NUnit is built with NAnt, there currently
is no way to target the 2.0 classlibs without patching NAnt first. 
And seeing how both NUnit and NAnt are both packaged differently for
.NET 1.0 and .NET 2.0, I think we can expect different packages for
Mono 1.0 and Mono 1.2, respectively.

Am I right in thinking that C# 2.0 support needs to be added to NUnit
and NAnt in the 1.2 timeframe?

If so, what else needs to be done besides the following?  Is this the
right approach? And how does it fit with Debian's Mono packaging
policy?
1) Extend NAnt to target Mono 1.2.
2) Extend nunit-mono to target Mono 1.0 AND Mono 1.2

Thanks for listening,

Edward Cho
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestGenerics.cs
Type: text/x-csharp
Size: 312 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-mono-devel/attachments/20060306/3a69d6f1/TestGenerics.bin


More information about the Pkg-mono-devel mailing list