如何使Visual Studio中暂停在调试模式下执行一个控制台应用程序后? [英] How to make Visual Studio Pause after executing a console app in debug mode?

查看:1168
本文介绍了如何使Visual Studio中暂停在调试模式下执行一个控制台应用程序后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有升压单元测试的集合我想作为控制台应用程序运行。

I have a collection of boost unit tests I want to run as a console application.

在我工作的项目,我进行的测试,我想能够调试测试,我想有控制台保持开放测试运行后。

When I'm working on the project and I run the tests I would like to be able to debug the tests and I would like to have the console stay open after the tests run.

我看到,如果我在释放模式运行控制台窗口中的程序退出后保持,但在调试模式,这是情况并非如此。

I see that if I run in release mode the console window stays up after the program exits, but in debug mode this is not the case.

我不想加入'系统(暂停);'或任何其他黑客就像读一字符我的程序。我只想让Visual Studio的停顿像是想如果我是在释放模式运行调试运行测试后。我也想,如果测试输出在Visual Studio中的输出窗口之一,被捕获但也似乎更难比它应该是。

I do not want to add 'system("pause");' or any other hacks like reading a character to my program. I just want to make Visual Studio pause after running the tests with debugging like it would if I were running in release mode. I would also like it if the output of tests were captured in one of Visual Studio's output windows but that also seems to be harder than it should be.

我怎样才能做到这一点?

How can I do this?

推荐答案

升压试验提供了以下<一个href=\"http://www.boost.org/doc/libs/1_56_0/libs/test/doc/html/utf/usage-recommendations/dot-net-specific.html\"相对=nofollow>使用Visual Studio的,这将使你在编译结束时自动运行单元测试并捕获输出到构建窗口的建议。

boost test offers the following usage recommendations for visual studio that would enable you to run the unit tests automatically at the end of compilation and capture the output into the build window.

这招的很好的副作用是它使您可以把测试失败的编译错误。 ......你可以通过这些错误通常使用键盘快捷键跳/鼠标点击您使用的编译错误分析......

the nice side effect of this trick is it enable you to treat test failures as compilation errors. "...you could jump through these errors using usual keyboard shortcuts/mouse clicks you use for compilation error analysis..."

这篇关于如何使Visual Studio中暂停在调试模式下执行一个控制台应用程序后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆