Possible bug in 0.7, TextWriter not used?

23 views
Skip to first unread message

vastevaste

unread,
Jul 23, 2012, 10:18:40 AM7/23/12
to nuni...@googlegroups.com
I tried the following program with the following output. It seems the TextWriter I passed is just ignored. Is this expected behaviour?

/Johan

==================

using System;
using System.IO;
using NUnit.Framework;

namespace nunitlitetest
{
    [TestFixture]
    public class MainClass
    {
        public static void Main (string[] args)
        {
            var sw = new StringWriter();
            new NUnitLite.Runner.TextUI(sw).Execute(args);
            Console.WriteLine("sw = \"" + sw + "\" (length = " + sw.ToString().Length + ")");
        }
       
        [Test]
        public void MyTestMethod() {
            Assert.That(1, Is.EqualTo(2));
        }
    }
}

======================

NUnitLite 0.7.0 ()
Copyright 2012, Charlie Poole

Runtime Environment -
    OS Version: Unix 2.6.38.11
  Mono Version: 4.0.30319.1

1 Tests : 0 Failures, 0 Errors, 0 Not Run
sw = "" (length = 0)

Charlie Poole

unread,
Jul 23, 2012, 11:08:55 AM7/23/12
to nuni...@googlegroups.com
Definitely a bug! The runner seems to be overwriting the provided TextWriter
and using Console directly. The expected behavior is that your StringWriter
should be used unless you run with -out:<filename> on the command line.

Please file a bug so we don't forget this!

Charlie
> --
> You received this message because you are subscribed to the Google Groups
> "NUnitLite" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nunitlite/-/WYny4szNafYJ.
> To post to this group, send email to nuni...@googlegroups.com.
> To unsubscribe from this group, send email to
> nunitlite+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nunitlite?hl=en.

vastevaste

unread,
Jul 23, 2012, 5:12:09 PM7/23/12
to nuni...@googlegroups.com
I can't promise I will, but feel free to file one for me! Better write a test for it, hehe.

Writing to file with -out seems to be working just fine.

/Johan

charlie於 2012年7月23日星期一UTC+2下午5時08分55秒寫道:
> nunitlite+unsubscribe@googlegroups.com.

Charlie Poole

unread,
Jul 23, 2012, 7:39:27 PM7/23/12
to nuni...@googlegroups.com
As it's critical, I filed a bug. Generally, it's a big help to the
developers if folks file bugs on the problems they find and
participate in their resolution by running tests.

In any case, thanks for finding this.

Charlie
>> > nunitlite+...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/nunitlite?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "NUnitLite" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nunitlite/-/mGQt2H-5VGAJ.
>
> To post to this group, send email to nuni...@googlegroups.com.
> To unsubscribe from this group, send email to
> nunitlite+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages