I've made these changes, and checked them in, but I have a sneaking
suspicion that this is not the correct place to close the writer.
The writer is created in the this block from IResultFormatter
NUnitTask.CreateFormatter(...)
TextWriter tw = new StreamWriter( outfile.Create());
retFormatter.SetOutput(tw);
return retFormatter;
Then the formatter is used. It seems like IResultFormatter should be
disposable, and that is when the writer should be closed. Or the creator
should take care of it.
It seems like your solution, although it works, will close the writer
that it doesn't necessary own. And could be a pre-mature closure.
> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:nant-developers-
> [EMAIL PROTECTED]] On Behalf Of Tomas Restrepo
> Sent: Friday, May 17, 2002 6:46 PM
> To: [EMAIL PROTECTED]
> Subject: [nant-dev] Bug in NUnit task
>
> Hi guys,
>
> I was doing some work trying to set up the simples of things: add a
mail
> task to one of my buildfiles that would add the NUnit result files of
my
> build as attachments, and figure my surprise when it didn't work!
>
> After fiddling around with it for a while, I found the problem: The
> TextWriter used in the NUnit formatters are never closed, so the
output
> files remain open untilk garbage collection in such a way that you
can't
> even access them for read-only!~
>
> Fortunately, this is very easy to fix. I did so by adding a
> Writer.Close()
> line to XmlResultFormatter.cs and PlainTextResultFormatter.cs right at
the
> end of the EndTestSuite() Method in each class.
>
> Could anyone with commit access make the change and commit it? It
would be
> great to have that fixed in the standard distribution...
>
> --
> Tomas Restrepo
> [EMAIL PROTECTED]
>
>
>
> _______________________________________________________________
> Hundreds of nodes, one monster rendering program.
> Now that's a super model! Visit http://clustering.foundries.sf.net/
>
> _______________________________________________
> Nant-developers mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/nant-developers
_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers