运行测试后保存单元测试结果 [英] Saving unit test results after running tests

查看:22
本文介绍了运行测试后保存单元测试结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio 2013 中,运行我的所有 Visual Studio 单元测试会显示测试结果,以及调用堆栈、异常信息和失败测试的堆栈跟踪.有没有办法在测试执行后保存测试结果,以便我可以打开以前运行的测试?

In Visual Studio 2013, running all my Visual Studio unit tests shows the test results, together with callstack, exception information and a stack trace of failing tests. Is there any way of saving the test results, after test execution, such that I can open up previously run tests?

我读过一些帖子,说明失败的测试结果会保留在 TestResults 文件夹中,而成功的测试会被删除.不幸的是,在运行测试后,失败或成功的测试结果都不会保留在我的 TestResults 文件夹中.

I have read posts that explain that failing test results are kept, in the TestResults folder, while successful tests are deleted. Unfortunately neither failing nor successful test results remain, in my TestResults folder, after running the tests.

我尝试创建和使用 .runsettings 文件并将元素设置为 false,但这并没有改变任何东西.

I tried creating and using a .runsettings file and setting the element to false, but this didn't change anything.

有谁知道如何保存测试结果,以备日后检查?

Anyone know how to keep the test results, for later inspection?

推荐答案

您好,我遇到了同样的问题,我的解决方案是使用命令控制台.

Hi I have the same problem, the solution for me was use command console.

您需要使用位于以下位置的 VSTest.console.exe:C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow

You need to use VSTest.console.exe located at : C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow

您应该使用 Visual Studio 命令提示符转到该位置.在该类型之后:VSTest.console yourFullProjectPath\YourTestProject\bin\reléase\YourTest.dll/logger:trx

You should go to that location using visual studio command prompt. After that type: VSTest.console yourFullProjectPath\YourTestProject\bin\reléase\YourTest.dll /logger:trx

完成后,您可以在 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\TestResults

问候

这篇关于运行测试后保存单元测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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