How to profile unit tests in Visual Studio 2012?

Is it possible to run the MSTest profile tester in Visual Studio 2012 Ultimate without using any external profiling tools?

+48
profiling unit-testing visual-studio-2012
Aug 19 '12 at 16:00
source share
3 answers

This feature was added in the upcoming quarterly update of Visual Studio 2012 1. Right-click the test you want to profile in the Testers Explorer and select "Profile Test" in the context menu.

+54
Oct 22
source share
β€” -

In Visual Studio, this was a really powerful feature! Like you, I cannot find it in VS2012 (no links on MSDN or blogs, ...)

Now, the only solution I have found for profiling Unit Test is to attach Profiler to a process called vstest.executionengine.x86.exe (x86 for me, but it may be different for 64 bits)

You can do this in the Performance Explorer tab after right-clicking.

enter image description here

Once the profiler starts, you can run as many tests as you want. Then stop profiling and you will see all the details of this session.

There are two caveats to this method:

  • for some reason, the process is not listed. Maybe he stops when he's idle. Start only one test and watch it.
  • You must connect Profiler for each session. I have not yet found a way to script it.

Hope this helps you.

+29
Sep 20 '12 at 19:18
source share

In Visual Studio 2015, follow the instructions provided by Cybermaxs, but select TE.ProcessHost.Managed . Unfortunately, there are apparently two of them, so you should choose the one with the higher CPU usage.

http://i.stack.imgur.com/1Wko1.png

0
Apr 28 '16 at 19:01
source share



All Articles