FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Console Output to VS?

 
Post new topic   Reply to topic     Forum Index -> Visual D
View previous topic :: View next topic  
Author Message
debio



Joined: 23 May 2008
Posts: 21

PostPosted: Wed Apr 06, 2011 12:10 am    Post subject: Console Output to VS? Reply with quote

When I build a console application, is it possible to get console output redirected into Visual Studio? The output view at the bottom has an option for "Program Output" but it has no effect. This is frustrating because if a unit test fails and I don't have debugging breakpoints set, I never see the output telling me where the unit test failed, and as far as I can tell, there's no way to get the debugger to stop when an assertion fails.
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Wed Apr 06, 2011 11:46 am    Post subject: Re: Console Output to VS? Reply with quote

debio wrote:
When I build a console application, is it possible to get console output redirected into Visual Studio? The output view at the bottom has an option for "Program Output" but it has no effect.


I've never seen a "Program Output" option for the output window (can't check on VS2010 right now, only VS2008). This might be specific to other languages (maybe C#)?

Quote:
This is frustrating because if a unit test fails and I don't have debugging breakpoints set, I never see the output telling me where the unit test failed, and as far as I can tell, there's no way to get the debugger to stop when an assertion fails.


You can enable breaking on exceptions including assertions. If you work with the default debugger, enable stopping when a Win32 Exception named "D Exception" is thrown. When using the Mago debugger, you can even select the type of exeption to stop on. See

http://www.dsource.org/projects/visuald/wiki/Tour/Debugger
Back to top
View user's profile Send private message
debio



Joined: 23 May 2008
Posts: 21

PostPosted: Wed Apr 06, 2011 1:24 pm    Post subject: Re: Console Output to VS? Reply with quote

sagitario wrote:
debio wrote:
When I build a console application, is it possible to get console output redirected into Visual Studio? The output view at the bottom has an option for "Program Output" but it has no effect.


I've never seen a "Program Output" option for the output window (can't check on VS2010 right now, only VS2008). This might be specific to other languages (maybe C#)?


I'm in VS2010, and it appears while I'm working on D projects. I mentioned that because I'm used to having it (Eclipse is generally my IDE of choice, and they use it everywhere), but if it isn't the norm for Visual Studio, I could get used to working that way.

sagitario wrote:

Quote:
This is frustrating because if a unit test fails and I don't have debugging breakpoints set, I never see the output telling me where the unit test failed, and as far as I can tell, there's no way to get the debugger to stop when an assertion fails.


You can enable breaking on exceptions including assertions. If you work with the default debugger, enable stopping when a Win32 Exception named "D Exception" is thrown. When using the Mago debugger, you can even select the type of exeption to stop on. See

http://www.dsource.org/projects/visuald/wiki/Tour/Debugger


It's odd because in that Exceptions window, all D exceptions are checked by default, but they aren't caught. If I uncheck them all and check core.exception.AssertError, the failed assert is caught, but if I recheck all D exceptions, it isn't caught.
Back to top
View user's profile Send private message
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Wed Apr 06, 2011 1:55 pm    Post subject: Reply with quote

Quote:
It's odd because in that Exceptions window, all D exceptions are checked by default, but they aren't caught. If I uncheck them all and check core.exception.AssertError, the failed assert is caught, but if I recheck all D exceptions, it isn't caught.


I think that is the bug mentioned in the wiki. Even though Mago is not one of my projects, I actually contributed part of the exception handling to it, so I might dig into this again sometime.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Visual D All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group