我不能在单元测试适配器中调试ITestExecutor方法吗? [英] Can I not debug the ITestExecutor methods in a unit test adapter?

查看:40
本文介绍了我不能在单元测试适配器中调试ITestExecutor方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用来自

Using the sample project from MSDN, I'm writing a custom unit test adapter. I'm able to debug it with the experimental instance in visual studio, set breakpoints, and see System.Diagnostics.Trace.WriteLine() output, and it all works beautifully for almost all of my methods. I can see evidence that it's working (as in the outputs of the test cases are what I expect if I fiddle with the error message, duration, etc).

但是,对于我的测试执行程序类中的方法(派生自 Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.ITestExecutor ),我既未达到断点,也未看到任何跟踪输出.是否有设置或使之起作用的东西?我想知道测试执行框架是否正在对该类进行某种优化,从而使调试变得更加困难.

However, for the methods in my test executor class (deriving from Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.ITestExecutor), I neither hit my breakpoints nor see any of my trace output. Is there a setting or something to make that work? I'm wondering if the test execution framework is doing some kind of optimization on this class that makes it harder to debug.

谢谢.

推荐答案

您必须将调试器附加到进程 vstest.executionengine.x86.exe 上,该进程是产生的子级devenv.exe .我假设测试发现代码对 vstest.discoveryengine.x86.exe 使用相同的技巧.

You have to attach the debugger to the process vstest.executionengine.x86.exe, which is a child spawned by devenv.exe. I'm assuming the same trick applies to vstest.discoveryengine.x86.exe for the test discovery code.

奖金问题:当我调试单元测试适配器项目时,是否可以将调试器设置为自动附加到那些调试器?

Bonus Question: Is there a way to set up the debugger to attach to those automatically when I debug my unit test adapter project?

这篇关于我不能在单元测试适配器中调试ITestExecutor方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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