statler / dxcorecommunityplugins

Automatically exported from code.google.com/p/dxcorecommunityplugins
0 stars 0 forks source link

Add redirection of Console output from RedGreen to Test output Window #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run test that uses Console.Writeline with TD.NET
2. Run test that uses Console.Writeline with RedGreen

You see console output merged into the result stream in one case, but not
the other.

Original issue reported on code.google.com by bartel...@gmail.com on 19 May 2009 at 11:08

GoogleCodeExporter commented 9 years ago

Original comment by RoryBec...@gmail.com on 19 May 2009 at 11:17

GoogleCodeExporter commented 9 years ago
I committed some changes last week that should adress your needs here. If it 
doesn't 
it will at least tell me where an exception is takeing place. 
I'll pester Rory for a new build on the community site.
Jim

Original comment by tenHoleH...@gmail.com on 20 May 2009 at 12:28

GoogleCodeExporter commented 9 years ago
Build 355 is up

Original comment by RoryBec...@gmail.com on 20 May 2009 at 12:33

GoogleCodeExporter commented 9 years ago
Hi guys, thanks for the prompt attention - I was only doing this as a shot in 
the
dark really hence the terse post!

Tried 355 on Vs2k5 SP1 with CR 9.1.3 and Gallio Version 3.0.6 build 763 and 
TD.NET
2.20.2438:-

Created a project[1] w/ 2 fixtures - 1 xUnit.NET, 1 NUnit.

1) I finally get the white bar idea (I still think I want it to be transparent 
so I
can see the attribute and any parameters on it)
2) TD.NET:
   When invoking the NUnit test with TD.NET, Console.WriteLine shows
   When invoking the xUnit.NET test with TD.NET, Console.WriteLine DOES NOT SHOW but
is available via link to gallio report (which isnt what I want)
3) RG:
   When invoking the NUnit test with TD.NET, Console.WriteLine DOES NOT SHOW 
   When invoking the xUnit.NET test with TD.NET, Console.WriteLine DOES NOT SHOW (and
is not available via the gallio report link)

I got some exceptions relating to RedGreen establishing context but cant repro 
and
didnt take copy of stack trace - will report if I can manage to repro at some 
stage.

[1]
using System;
using Xunit;
using NUnit.Framework;

namespace ClassLibrary1
{
    [TestFixture]
    public class NUNitTests
    {
        [Test]
        public void Test()
        {
            Console.WriteLine("Hello from NUnit");
        }
    }
    public class xUnitNetTests
    {
        [Fact]
        public void Test()
        {
            Console.WriteLine("Hello from xUnit");
        }
    }
}

Original comment by bartel...@gmail.com on 21 May 2009 at 9:54

GoogleCodeExporter commented 9 years ago
I initially created RedGreen by extending the xUnit runner API. I then switched 
to 
Gallio so I'd only have one runner to deal with. It looks like Gallio is eating 
the 
console.WritelLine from your test. It is not in the results I get back. 

I'm going to start using the xUnit facilities again soon. In part because it is 
so 
much faster than Gallio. When this happens I expect you'll see the writeline in 
the 
test output window. 

In the mean time if all you are looking for is being able to write to the 
console to 
play with some code feature, try using ad-hoc tests. Simply create a method 
with no 
parameters and RedGreen will run it and put the result, as well as anything you 
write to the console) in the test output window.

FYI. Working with your sample code unveiled another bug for me. One I found a 
long 
time ago and thought I'd fixed, but I see now that solution didn't really do a 
complete job. Because this causes a crash in RedGreen, it will get my attention 
before trying to use xUnit directly again.

Original comment by tenHoleH...@gmail.com on 21 May 2009 at 12:37

GoogleCodeExporter commented 9 years ago
When you do this, (go back to Xunit) any chance you can do it through an 
interface of
some kind, in case someone wants to add explicit support for the other engines.

Original comment by RoryBec...@gmail.com on 21 May 2009 at 12:43

GoogleCodeExporter commented 9 years ago
That would be the plan. Everything is done via an interface and/or base classes 
now.

Original comment by tenHoleH...@gmail.com on 21 May 2009 at 1:29

GoogleCodeExporter commented 9 years ago
Thanks guys - While I dont hate TD.NET (and it's facilities are a better 
solution for
me right now), I'm strongly drawn to RedGreen.

The perf of going through Gallio is a slight concern for me too (In general I 
lean
towards xUnit.NET followed by NU 2.5 but have legacy MSTest stuff).

Not sure where to put this, but before I would start using RedGreen in depth, 
I'd be
looking for a TD.NET-like "rerun last test batch" facility, and I'd need to be 
able
to invoke without a mouse (activation via the Refactor button seemed flaky when 
I
played with it today).

While I'm throwing feature ideas at busy people with no fear for the 
consequences...
Alongside a "rerun last test batch" facility, if RedGreen could do an 
Nunit-Gui-2.5
type "rerun when you detect changes" to automatically re-run a set on 
recompilation
would be the business.

(I have:
a refactor button, 
shift-Ctrl refactor to switch to a test (TD.NET run test(s))
shift refactor to rerun (TD.NET rerun last tests)
Ctrl-Alt refactor to rerun with debugger (TD.NET rerun with edit and continue)

Having all those functions exposed as functions that can have keys wired to them
makes for a very configurable setup without going near a mouse.

Having said all that, please take this all with a grain of salt - I have but an
inkling of how the many dependencies RG has must lead to such a clean utility 
being a
stack of work to write.

--R

Original comment by bartel...@gmail.com on 21 May 2009 at 3:32