Re: CountTestCases fails in 2.4.1

"Charlie Poole" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <003401c81cb8$525065e0$6501a8c0@FERRARI>
Hi Erik,

> I'm using NAnt-0.85 and NUnit-2.4.1 to build and test my 
> project. On Windows/.Net-2.0 this works without a problem, 
> but on Linux/mono-1.2.5.1, NUnit keeps crashing, even before 
> it loads the first test case.
> 
> NUnit keeps throwing a System.NullReferenceException when 
> counting the test cases:
> 
> test:
> 
>       [exec] NUnit version 2.4.1
>       [exec] Copyright (C) 2002-2007 Charlie Poole.
>       [exec] Copyright (C) 2002-2004 James W. Newkirk, 
> Michael C. Two, Alexei A. Vorontsov.
>       [exec] Copyright (C) 2000-2002 Philip Craig.
>       [exec] All Rights Reserved.
>       [exec] Runtime Environment -
>       [exec]    OS Version: Unix 2.6.20.1
>       [exec]   CLR Version: 2.0.50727.42 ( Mono 1.2.5.1 )
>       [exec] Unhandled Exception:
>       [exec] System.NullReferenceException: Object reference 
> not set to an instance of an object
>       [exec] Server stack trace:
>       [exec]   at NUnit.Core.SimpleTestRunner.CountTestCases 
> (ITestFilter filter) [0x00000]
>       [exec]   at NUnit.Core.DelegatingTestRunner.CountTestCases 
> (ITestFilter filter) [0x00000]
>       [exec]   at NUnit.Core.DelegatingTestRunner.CountTestCases 
> (ITestFilter filter) [0x00000]
>       [exec]   at (wrapper xdomain-dispatch) 
> NUnit.Core.DelegatingTestRunner:CountTestCases 
> (object,byte[]&,byte[]&)
>       [exec] Exception rethrown at [0]:
>       [exec]   at (wrapper xdomain-invoke) 
> NUnit.Core.DelegatingTestRunner:CountTestCases 
> (NUnit.Core.ITestFilter)
>       [exec]   at NUnit.Util.ProxyTestRunner.CountTestCases 
> (ITestFilter 
> filter) [0x00000]
>       [exec]   at NUnit.Util.AggregatingTestRunner.CountTestCases 
> (ITestFilter filter) [0x00000]
>       [exec]   at NUnit.Util.AggregatingTestRunner.Run (EventListener 
> listener, ITestFilter filter) [0x00000]
>       [exec]   at NUnit.ConsoleRunner.ConsoleUi.Execute 
> (NUnit.ConsoleRunner.ConsoleOptions options) [0x00000]
>       [exec]   at NUnit.ConsoleRunner.ConsoleUi.Main (System.String[] 
> args) [0x00000]
> 
> BUILD FAILED
> 
> What am I doing wrong?

There was a bug, fixed in later versions, where running with a separate
AppDomain per assembly - AggregatingTestRunner on the stack tells me
that's what you are doing - caused a null reference.

You can test to see if that's what's happening to you by running
only a single assembly or specifying -domain:Single on the command line.

If that workaround is OK, try 2.4.4. It has some gui issues, but fewer
than the preceding releases and it has been reported (not verified)
that the copy of log4net distributed with it causes problems under
Mono 1.0 profile in some situations, because I mistakenly distributed
with the .NET 1.1 version rather than the Mono version of log4net.dll.
You should be able to make a direct replacement of that assembly in
the NUnit lib directory.

There will also be a bug fix release as quickly as I can get it out.

Charlie

> regards,
> Erik van Zijst
> 
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and 
> a browser.
> Download your FREE copy of Splunk now >> 
> http://get.splunk.com/ _______________________________________________
> Nunit-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nunit-users
> 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.