Can I not debug the ITestExecutor methods in a unit test adapter?

落花浮王杯 提交于 2019-12-24 16:11:07

问题


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).

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.

Thank you.


回答1:


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?



来源:https://stackoverflow.com/questions/24811460/can-i-not-debug-the-itestexecutor-methods-in-a-unit-test-adapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!