Can I debug ITestExecutor methods in unit test adapter?

Using a sample project from MSDN , I am writing a custom unit test adapter. I can debug it using an experimental instance in visual studio, set breakpoints and see the output of System.Diagnostics.Trace.WriteLine() , and all this works fine for almost all of my methods. I see evidence that it works (as in the results of test cases, I expect if I play with an error message, duration, etc.).

However, for the methods in the test runner class (based on Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.ITestExecutor ) I did not hit the breakpoints and did not see any of my trace results. Is there a setup or something to do for this job? I am wondering if the test runtime does any kind of optimization for this class, which makes it difficult to debug.

Thank.

+1
debugging unit-testing visual-studio-2012
Jul 17 '14 at
source share
1 answer

You must attach the debugger to the vstest.executionengine.x86.exe process, which is the child spawned by devenv.exe . I assume the same trick applies to vstest.discoveryengine.x86.exe for test detection code.

Bonus question: is there a way to configure the debugger to automatically attach to them when I debug the unit test adapter project?

+2
Jul 22 '14 at 16:13
source share



All Articles