Re: Console output format and Visual Studio (2005)
"Charlie Poole" <[email protected]> Fri, 28 Nov 2008 14:44:13 -0800
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <001401c951aa$d9ff7ee0$6401a8c0@ferrari> |
This is a multi-part message in MIME format. --===============1710802378179079613== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0015_01C95167.CBDC3EE0" This is a multi-part message in MIME format. ------=_NextPart_000_0015_01C95167.CBDC3EE0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Yeah, StackTraceFilter is used by the GUI as well, so that's not such a good hack. :-) StackTraceFilter is intended to filter a stacktrace by removing things, not to change its appearance. To write to the console from EventCollector, just write use Console.WriteLine. Under VS, you should see your text in the output pane. Charlie _____ From: riemann tolow [mailto:[email protected]] Sent: Friday, November 28, 2008 2:29 PM To: [email protected] Cc: [email protected] Subject: Re: [Nunit-users] Console output format and Visual Studio (2005) Hi, I "hacked" NUnit.Util.StackTraceFilter to format the message there. It works with VS post-build event, but it is a hack. I may have broken the debug mode output (as it uses the same function) but I haven't tested it yet. Charlie, how to make the Eventcollector writes to the out console. I can't see where it writes to the debug console in the first place :) thanks rmn _____ Date: Thu, 27 Nov 2008 16:44:12 -0700 From: [email protected] To: [email protected] Subject: Re: [Nunit-users] Console output format and Visual Studio (2005) CC: [email protected] It's not a "simple" mod. If I remember correctly, I had to modify 4 or 5 files. I don't have the code with me atm, but if you're interested, I could post the modifications I've made later. On Thu, Nov 27, 2008 at 12:36 PM, riemann tolow <[email protected]> wrote: Hi, I am interested to now where and what modification must be made to get this feature working. I found the place where NUnit format the exception stack under debug mode (EvenCollector) But couldn't find where is formats the exception stack trace for the console ouput. thanks rmn >I'll modify my version, and keep an eye out for this feature in an ulterior >version then! >Thank you very much for the info. > >joce. > >On Tue, Sep 9, 2008 at 7:47 PM, Charlie Poole ><charlie@po...>wrote: > >> Hi, >> >> When you run as a post-build step, you are not running "in debug mode under >> Visual Studio" >> >> Many folks have independently come up with this way to integrate NUnit into >> VS, but it's >> not how the NUnit developers pictured running NUnit under VS, so it >> doesn't work as >> smoothly as it could. >> >> You can of course continue to run that way, but without the line formatting >> you would >> like to see, or you can set up nunit-console as the debug application and >> use the >> trace output, which is formatted as you want. >> >> Modifying the normal console output so that it can be used effectively in >> the way you >> describe has been requested as a feature and will be included in a future >> release. >> >> Charlie >> >> ------------------------------ >> *From:* nunit-users-bounces@li... [mailto: >> nunit-users-bounces@li...] *On Behalf Of *Jocelyn Legault >> *Sent:* Tuesday, September 09, 2008 6:30 PM >> *To:* nunit-users@li... >> *Subject:* Re: [Nunit-users] Console output format and Visual Studio >> (2005) >> >> Anyone? >> >> On Mon, Sep 8, 2008 at 10:01 PM, Jocelyn Legault <jocelynlegault@gm... >> > wrote: >> >>> Hello. >>> >>> I'm new to NUnit (and to C# in general). I'm currently trying to >>> integrate NUnit with my project, using it as a post-build step to run the >>> tests. >>> >>> From the local documentation file >>> file:///C:/Program%20Files/NUnit%202.4.7/doc/vsSupport.html (also on the web >>> at http://www.nunit.org/index.php?p=vsSupport <http://www.nunit.org/index.php?p=vsSupport&r=2.2> &r=2.2), it is stated that: >>> >>> *When the nunit-console program is run in debug mode under Visual Studio, >>>> it detects that it is running in this mode and sends output to the Visual >>>> Studio output window. Output is formatted so that double clicking any error >>>> or failure entries opens the appropriate test file at the location where the >>>> failure was detected.* >>> >>> >>> To me, that means that the output should be such as: >>> C:\Projects\tests\TestNUnit\TestNUnit\Program.cs(24,10): error CS1002: ; >>> expected >>> >>> But instead, what I get is: >>> at TestNUnit.MyFirstTest.Test1() in >>> C:\Projects\tests\TestNUnit\TestNUnit\Program.cs:line 23 >>> which is sadly not recognized by MSDev. >>> >>> FYI, the post-build event command line that I use is: >>> "C:\Program Files\NUnit 2.4.7\bin\nunit-console.exe" $(ProjectPath) >>> /nologo >>> >> Is there some switch I should use to format the output? I've looked at the >> options and I haven't seen anything that seems to do that. >> >> Thanks, >> >> joce. _____ Connect to the next generation of MSN Messenger Get <http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source= wlmailtagline> it now! ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100 <http://moblin-contest.org/redirect.php?banner_id=100&url=/> &url=/ _______________________________________________ Nunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nunit-users _____ Connect to the next generation of MSN Messenger Get it now! <http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source= wlmailtagline> ------=_NextPart_000_0015_01C95167.CBDC3EE0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <STYLE>.hmmessage P { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: = 0px; PADDING-TOP: 0px } BODY.hmmessage { FONT-SIZE: 10pt; FONT-FAMILY: Verdana } </STYLE> <META content=3D"MSHTML 6.00.6000.16705" name=3DGENERATOR></HEAD> <BODY class=3Dhmmessage> <DIV><SPAN class=3D734264022-28112008><FONT face=3DArial = color=3D#0000ff>Yeah,=20 StackTraceFilter is used by the GUI as well, so that's not such a good = hack.=20 :-)</FONT></SPAN></DIV> <DIV><SPAN class=3D734264022-28112008><FONT face=3DArial=20 color=3D#0000ff></FONT></SPAN> </DIV> <DIV><SPAN class=3D734264022-28112008><FONT face=3DArial=20 color=3D#0000ff>StackTraceFilter is intended to filter a stacktrace by = removing=20 things, not to </FONT></SPAN></DIV> <DIV><SPAN class=3D734264022-28112008><FONT face=3DArial = color=3D#0000ff>change its=20 appearance.</FONT></SPAN></DIV> <DIV><SPAN class=3D734264022-28112008><FONT face=3DArial=20 color=3D#0000ff></FONT></SPAN> </DIV> <DIV><SPAN class=3D734264022-28112008><FONT face=3DArial = color=3D#0000ff>To write to=20 the console from EventCollector, just write use=20 Console.WriteLine.</FONT></SPAN></DIV> <DIV><FONT face=3DArial><FONT color=3D#0000ff><SPAN = class=3D734264022-28112008>Under=20 VS, you should see your text in the output = pane.</SPAN></FONT></FONT></DIV> <DIV><FONT face=3DArial><FONT color=3D#0000ff><SPAN=20 class=3D734264022-28112008></SPAN></FONT></FONT> </DIV> <DIV><FONT face=3DArial><FONT color=3D#0000ff><SPAN=20 class=3D734264022-28112008>Charlie</SPAN></FONT></FONT></DIV> <DIV><SPAN class=3D734264022-28112008><FONT face=3DArial=20 color=3D#0000ff></FONT></SPAN> </DIV><BR> <BLOCKQUOTE=20 style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px = solid; MARGIN-RIGHT: 0px"> <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft> <HR tabIndex=3D-1> <FONT face=3DTahoma><B>From:</B> riemann tolow = [mailto:[email protected]]=20 <BR><B>Sent:</B> Friday, November 28, 2008 2:29 PM<BR><B>To:</B>=20 [email protected]<BR><B>Cc:</B>=20 [email protected]<BR><B>Subject:</B> Re: [Nunit-users] = Console=20 output format and Visual Studio (2005)<BR></FONT><BR></DIV> <DIV></DIV>Hi,<BR><BR>I "hacked" NUnit.Util.StackTraceFilter to format = the=20 message there. It works with VS post-build event, but it is a = hack.<BR>I may=20 have broken the debug mode output (as it uses the same function) but I = haven't=20 tested it yet.<BR><BR>Charlie, how to make the Eventcollector writes = to the=20 out console. I can't see where it writes to the debug console in the = first=20 place :)<BR><BR>thanks<BR>rmn<BR><BR> <HR id=3DstopSpelling> Date: Thu, 27 Nov 2008 16:44:12 -0700<BR>From: = [email protected]<BR>To:=20 [email protected]<BR>Subject: Re: [Nunit-users] Console output = format and=20 Visual Studio (2005)<BR>CC: = [email protected]<BR><BR>It's not=20 a "simple" mod. If I remember correctly, I had to modify 4 or 5 = files.<BR>I=20 don't have the code with me atm, but if you're interested, I could = post the=20 modifications I've made later.<BR><BR> <DIV class=3DEC_gmail_quote>On Thu, Nov 27, 2008 at 12:36 PM, riemann = tolow=20 <SPAN dir=3Dltr><<A=20 href=3D"mailto:[email protected]">[email protected]</A>></SPAN> = wrote:<BR> <BLOCKQUOTE class=3DEC_gmail_quote style=3D"PADDING-LEFT: 1ex"> <DIV>Hi,<BR><BR>I am interested to now where and what modification = must be=20 made to get this feature working.<BR><BR>I found the place where = NUnit=20 format the exception stack under debug mode (EvenCollector) But = couldn't=20 find where is formats the exception stack trace for the console=20 ouput.<BR><BR>thanks<BR>rmn<BR><BR><BR>>I'll modify my version, = and keep=20 an eye out for this feature in an ulterior<BR>>version = then!<BR>>Thank=20 you very much for the info.<BR>><BR>>joce.<BR>><BR>>On = Tue, Sep=20 9, 2008 at 7:47 PM, Charlie=20 Poole<BR>><charlie@po...>wrote:<BR>><BR>>>=20 Hi,<BR>>><BR>>> When you run as a post-build step, you = are not=20 running "in debug mode under<BR>>> Visual=20 Studio"<BR>>><BR>>> Many folks have independently come = up with=20 this way to integrate NUnit into<BR>>> VS, but = it's<BR>>> not=20 how the NUnit developers pictured running NUnit under VS, so = it<BR>>>=20 doesn't work as<BR>>> smoothly as it = could.<BR>>><BR>>>=20 You can of course continue to run that way, but without the line=20 formatting<BR>>> you would<BR>>> like to see, or you can = set up=20 nunit-console as the debug application and<BR>>> use = the<BR>>>=20 trace output, which is formatted as you = want.<BR>>><BR>>>=20 Modifying the normal console output so that it can be used = effectively=20 in<BR>>> the way you<BR>>> describe has been requested = as a=20 feature and will be included in a future<BR>>>=20 release.<BR>>><BR>>> Charlie<BR>>><BR>>>=20 ------------------------------<BR>>> *From:* = nunit-users-bounces@li...=20 [mailto:<BR>>> nunit-users-bounces@li...] *On Behalf Of = *Jocelyn=20 Legault<BR>>> *Sent:* Tuesday, September 09, 2008 6:30 = PM<BR>>>=20 *To:* nunit-users@li...<BR>>> *Subject:* Re: [Nunit-users] = Console=20 output format and Visual Studio<BR>>> = (2005)<BR>>><BR>>>=20 Anyone?<BR>>><BR>>> On Mon, Sep 8, 2008 at 10:01 PM, = Jocelyn=20 Legault <jocelynlegault@gm...<BR>>> >=20 wrote:<BR>>><BR>>>> = Hello.<BR>>>><BR>>>>=20 I'm new to NUnit (and to C# in general). I'm currently trying=20 to<BR>>>> integrate NUnit with my project, using it as a = post-build=20 step to run the<BR>>>> = tests.<BR>>>><BR>>>> From=20 the local documentation file<BR>>>>=20 file:///C:/Program%20Files/NUnit%202.4.7/doc/vsSupport.html (also on = the=20 web<BR>>>> at <A=20 = href=3D"http://www.nunit.org/index.php?p=3DvsSupport&r=3D2.2">http://= www.nunit.org/index.php?p=3DvsSupport&r=3D2.2</A>),=20 it is stated that:<BR>>>><BR>>>> *When the = nunit-console=20 program is run in debug mode under Visual = Studio,<BR>>>>> it=20 detects that it is running in this mode and sends output to the=20 Visual<BR>>>>> Studio output window. Output is formatted = so that=20 double clicking any error<BR>>>>> or failure entries = opens the=20 appropriate test file at the location where the<BR>>>>> = failure=20 was detected.*<BR>>>><BR>>>><BR>>>> To = me, that=20 means that the output should be such as:<BR>>>>=20 C:\Projects\tests\TestNUnit\TestNUnit\Program.cs(24,10): error = CS1002:=20 ;<BR>>>> expected<BR>>>><BR>>>> But = instead, what=20 I get is:<BR>>>> at TestNUnit.MyFirstTest.Test1()=20 in<BR>>>> = C:\Projects\tests\TestNUnit\TestNUnit\Program.cs:line=20 23<BR>>>> which is sadly not recognized by=20 MSDev.<BR>>>><BR>>>> FYI, the post-build event = command=20 line that I use is:<BR>>>> "C:\Program Files\NUnit=20 2.4.7\bin\nunit-console.exe" $(ProjectPath)<BR>>>>=20 /nologo<BR>>>><BR>>> Is there some switch I should = use to=20 format the output? I've looked at the<BR>>> options and I = haven't seen=20 anything that seems to do that.<BR>>><BR>>>=20 Thanks,<BR>>><BR>>> joce.<BR> <DIV class=3DEC_WgoR0d><BR> <HR> Connect to the next generation of MSN Messenger <A=20 = href=3D"http://imagine-msn.com/messenger/launch80/default.aspx?locale=3De= n-us&source=3Dwlmailtagline">Get=20 it now!=20 = </A></DIV></DIV><BR>-----------------------------------------------------= --------------------<BR>This=20 SF.Net email is sponsored by the Moblin Your Move Developer's=20 challenge<BR>Build the coolest Linux based applications with Moblin = SDK=20 & win great prizes<BR>Grand prize is a trip for two to an Open = Source=20 event anywhere in the world<BR><A=20 = href=3D"http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D= /">http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/</A>= <BR>_______________________________________________<BR>Nunit-users=20 mailing list<BR><A=20 = href=3D"mailto:[email protected]">[email protected]= eforge.net</A><BR><A=20 = href=3D"https://lists.sourceforge.net/lists/listinfo/nunit-users">https:/= /lists.sourceforge.net/lists/listinfo/nunit-users</A><BR><BR></BLOCKQUOTE= ></DIV><BR><BR> <HR> Connect to the next generation of MSN Messenger <A=20 = href=3D"http://imagine-msn.com/messenger/launch80/default.aspx?locale=3De= n-us&source=3Dwlmailtagline"=20 target=3D_new>Get it now! </A></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_0015_01C95167.CBDC3EE0-- --===============1710802378179079613== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ --===============1710802378179079613== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Nunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nunit-users --===============1710802378179079613==--