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.
In Test Explorer, select the test method(s) and then choose Debug on the right-click menu.
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With