Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F5 to run Visual Studio Test in debugger

I'm using Visual Studio Test for C++, and am debugging a specific test. Microsoft has provided all kinds of ways to run the test in the debugger, but none that I really like. I am getting tired of having to go find the test code and then press Ctrl+R, Ctrl+T (or mousing around which I hate). I want Ctrl+R, Ctrl+T behavior from any source code context.

Is there a way to hook F5 to run the selected test(s) in the debugger?

I've tried setting my test project as startup, but that makes F5 "unable to start" because the test is a DLL.

like image 724
jws Avatar asked Jul 03 '13 13:07

jws


People also ask

How do I run a test in debug mode?

In Test Explorer, select the test method(s) and then choose Debug on the right-click menu.

What is Ctrl F5 in Visual Studio?

F5 & Ctrl-F5 F5 is used to start your project in debug mode and Ctrl-F5 is used to start your project without debug mode.


1 Answers

Locate your vstest.console.exe to run the test DLL via F5.

In my Visual Studio 2017 Community edition that would be putting the following path into Start external program under Debug settings:

 C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

And as Command line arguments just put the DLLs file name. Now you can use F5 to start debugging a test when Set as StartUp Project.

like image 69
Florian Avatar answered Sep 19 '22 21:09

Florian