有没有办法在测试执行期间显示控制台输出? [英] Is there a way to show console output during test execution?

查看:91
本文介绍了有没有办法在测试执行期间显示控制台输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题所说的简单问题。我希望将输出视为运行时出于调试目的,但测试完成后运行的标准视图控制台输出显然无法实现。


 


我确实有办法将我的项目编译成一个dll,并从项目外部的编译控制台应用程序设置中调用它。我可以这样做,因为当我在VSTS中运行时,我使用自己的测试用例/结果结构只运行1 [TestMethod](从
控制台应用程序我直接调用obj [TestMethod]调用)。这种方法更容易分发到测试机器而不是控制台输出,但它是该方法的一个很好的副产品。在任何情况下,这似乎是一种迂回的方式来实现调试目的的
控制台输出。我假设我也可以尾随一个日志文件,但这也感觉不对。这样做有"最佳实践"方法吗?即使它不是控制台输出,只是像QTP的打印窗口那样实时可见输出。

解决方案

检查
http://social.msdn.microsoft.com/Forums/en-US/vsautotest /线程/ d175244a-f9f2-4ba3-8307-ae0686b8a45f /

Simple question as the title says. I like to see the output as a run occurs for debugging purposes, but the standard view console output after the test is finished running doesn't accomplish this obviously.

 

I do have a way of doing this compiling my project into a dll and calling it from a compiled console application setup external to the project. I can do this as I use my own test case/results structures only running 1 [TestMethod] when I run in VSTS (from console app I just directly call the obj the [TestMethod] calls). This approach is for easier distribution to test machines not console output, but it's a nice byproduct of the approach. In any case this seems like a roundabout way of doing things to get live console output for debug purposes. I assume I could also tail a log file too, but that feels wrong too. Is there a 'best practice' method of doing this? Even if it's not console output just live visible output something like QTP's print window.

解决方案

Check http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/d175244a-f9f2-4ba3-8307-ae0686b8a45f/.


这篇关于有没有办法在测试执行期间显示控制台输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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