Re: Console output format and Visual Studio (2005)
"Charlie Poole" <[email protected]> Tue, 9 Sep 2008 18:47:10 -0700
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <000c01c912e7$26862280$6401a8c0@ferrari> |
This is a multi-part message in MIME format. --===============1661726945== Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01C912AC.7A274A80" This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C912AC.7A274A80 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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: [email protected] [mailto:[email protected]] On Behalf Of Jocelyn Legault Sent: Tuesday, September 09, 2008 6:30 PM To: [email protected] Subject: Re: [Nunit-users] Console output format and Visual Studio (2005) Anyone? On Mon, Sep 8, 2008 at 10:01 PM, Jocelyn Legault <[email protected]> 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. ------=_NextPart_000_000D_01C912AC.7A274A80 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"> <META content=3D"MSHTML 6.00.6000.16705" name=3DGENERATOR></HEAD> <BODY> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>Hi,</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>When=20 you run as a post-build step, you are not running "in debug mode under = Visual=20 Studio"</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>Many=20 folks have independently come up with this way to integrate NUnit into = VS, but=20 it's</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>not=20 how the</FONT></SPAN><SPAN class=3D968034001-10092008><FONT face=3DArial = color=3D#0000ff size=3D2> NUnit developers pictured running NUnit under = VS, so it=20 doesn't work as</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>smoothly as it could.</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>You=20 can of course continue to run that way, but without the line formatting = you=20 would</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>like=20 to see, or you can set up nunit-console as the debug application and use = the=20 </FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>trace=20 output, which is formatted as you want.</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>Modifying the normal console output so that it can be used = effectively in=20 the way you</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>describe has </FONT></SPAN><SPAN = class=3D968034001-10092008><FONT=20 face=3DArial color=3D#0000ff size=3D2>been requested as a feature and = will be included=20 in a future release.</FONT></SPAN></DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D968034001-10092008><FONT face=3DArial color=3D#0000ff = size=3D2>Charlie</FONT></SPAN></DIV><BR> <BLOCKQUOTE dir=3Dltr=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 size=3D2><B>From:</B>=20 [email protected]=20 [mailto:[email protected]] <B>On Behalf Of = </B>Jocelyn=20 Legault<BR><B>Sent:</B> Tuesday, September 09, 2008 6:30 = PM<BR><B>To:</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> <DIV dir=3Dltr>Anyone?<BR><BR> <DIV class=3Dgmail_quote>On Mon, Sep 8, 2008 at 10:01 PM, Jocelyn = Legault <SPAN=20 dir=3Dltr><<A=20 = href=3D"mailto:[email protected]">[email protected]</A>>= </SPAN>=20 wrote:<BR> <BLOCKQUOTE class=3Dgmail_quote=20 style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: = rgb(204,204,204) 1px solid"> <DIV dir=3Dltr>Hello.<BR><BR>I'm new to NUnit (and to C# in = general). =20 I'm currently trying to integrate NUnit with my project, using it as = a=20 post-build step to run the tests.<BR><BR>From the local = documentation=20 file = file:///C:/Program%20Files/NUnit%202.4.7/doc/vsSupport.html (also=20 on the web at <A = href=3D"http://www.nunit.org/index.php?p=3DvsSupport&r=3D2.2"=20 = target=3D_blank>http://www.nunit.org/index.php?p=3DvsSupport&r=3D2.2<= /A>), it=20 is stated that:<BR><BR> <BLOCKQUOTE class=3Dgmail_quote=20 style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: = rgb(204,204,204) 1px solid"><I>When=20 the nunit-console program is run in debug mode under Visual = Studio, it=20 detects that it is running in this mode and sends output to the = Visual=20 Studio output window. Output is formatted so that double clicking = any=20 error or failure entries opens the appropriate test file at the = location=20 where the failure was detected.</I></BLOCKQUOTE> <DIV><BR>To me, that means that the output should be such as: =20 <BR><FONT=20 face=3D"courier = new,monospace">C:\Projects\tests\TestNUnit\TestNUnit\Program.cs(24,10):=20 error CS1002: ; expected<BR><FONT = face=3Darial,helvetica,sans-serif><BR>But=20 instead, what I get is:<BR><SPAN=20 style=3D"FONT-FAMILY: courier new,monospace">at = TestNUnit.MyFirstTest.Test1()=20 in C:\Projects\tests\TestNUnit\TestNUnit\Program.cs:line = 23</SPAN><BR=20 style=3D"FONT-FAMILY: courier new,monospace">which is sadly not = recognized by=20 MSDev.<BR><BR>FYI, the post-build event command line that I use is:=20 <BR>"C:\Program Files\NUnit 2.4.7\bin\nunit-console.exe" = $(ProjectPath)=20 /nologo <BR><BR></FONT></FONT><FONT face=3D"courier = new,monospace"><FONT=20 face=3Darial,helvetica,sans-serif>Is there some switch I should use = to format=20 the output? I've looked at the options and I haven't seen anything = that=20 seems to do that.<BR></FONT></FONT><BR><FONT=20 face=3D"courier new,monospace"><FONT=20 = face=3Darial,helvetica,sans-serif>Thanks,<BR><BR>joce.<BR></FONT></FONT><= /DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_000D_01C912AC.7A274A80-- --===============1661726945== 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=/ --===============1661726945== 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 --===============1661726945==--