[MonoDevelop] First go at unit tests

Jacob Ilsø Christensen jacobilsoe at gmail.com
Wed Nov 30 16:24:43 EST 2005

On 11/30/05, Lluis Sanchez <lluis at ximian.com> wrote:

> Hi,
> Before starting to build this test infrastructure it would be good to
> think about what are we going to test and how to do it.
> About what: writing a test for Task is easy, but I feel it doesn't add
> much value. I know it's just an example, but what I mean is that we need
> to decide which classes are important to test. The current API is not
> final. Some classes will change, some will desapear, some will be made
> private, so writing tests for those would be a lose of time.

 I agree. It is most important to test complicated things.
The TaskTest is as you said just an illustration, not necessarily a test we
want to write.

> About how: MonoDevelop.Ide (and most of the MonoDevelop.* assemblies) is
> not just a standalone dll, it's an add-in. It needs to be loaded by the
> MonoDevelop runtime, and it needs to be properly initialized. Otherwise,
> it is not guaranteed to work at all.

That is true, but it might still be possible to test those things. We could
do a mock MonoDevelop runtime for example.
All this is just because I think it will add value to MonoDevelop and make
it easier to code. I would really have liked to write some unit tests for
the search patch I submitted yesterday, but there was no framework, so I

> This could be a problem with NUnit. I know that NUnit can do per-class
> test initialization, but we would need per-assembly initialization.

We would have to think more about this.

> Another problem I see is that many of the classes in MonoDevelop.Gui are
> designed to run in the GUI thread, and all in the same app domain. AFAIK
> NUnit creates its own test threads and app domains, so we'd need to
> think about how to handle this.

We need to think about this too, I agree.

> Lluis.

I mean, it is no harm to add some unit tests that might not make much value
since it might encourage other to write tests too.
The important thing is to get started so it is easier to add test IMO.
Shall I commit the stuff and we take it from there, or should things be
organized another way?


> El mié, 30-11-2005 a las 20:04 +0100, Jacob Ilsø Christensen escribió:
> > Hi.
> >
> > The attached patch changes some Makefiles to accomplish testing of
> > MonoDevelop.Ide.dll. In addition the file TaskTest.cs should be put
> > here:
> >
> > monodevelop/Core/src/MonoDevelop.Ide/Test/MonoDevelop.Ide.Tasks
> >
> > Right now it is assumed that the nunit assemblies are in the GAC and
> > that nunit-console.exe is in the path.
> >
> > make test builds MonoDevelop.Ide.dll and MonoDevelop.Ide.Test.dll and
> > then runs nunit-console.exe on MonoDevelop.Ide.Test.dll.
> >
> > Is this the way we should go? Will someone try it out on their system
> > to see if it works as expected?
> >
> > Thanks in advance,
> > Jacob
> > _______________________________________________
> > Monodevelop-list mailing list
> > Monodevelop-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/monodevelop-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20051130/87cd0025/attachment-0001.html

More information about the Monodevelop-list mailing list