有没有办法在测试执行期间显示控制台输出

有没有办法在测试执行期间显示控制台输出

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

问题描述

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


 


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

解决方案

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.

解决方案


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

08-31 09:58