JohnnyHendriks / TestAdapter_Catch2

Visual Studio Test Adapter for Catch2
MIT License
104 stars 29 forks source link

No way to see test result with Debug Selected Tests and DebugBreak off #60

Closed stinos closed 2 years ago

stinos commented 2 years ago

Adapter version 1.8.0 with latest Catch release 2.13.9, VS2017. With DebugBreak set to off in the runsettings file (which I mainly did because after a while it becomes quite annoying to always have to go back and forth between catch.hpp and the actual source), using Debug Selected Tests somehow results in test results not being made available in any way: while running there's no output (not in Test Explorer, not in the Output Window, not in the Immediate Window, there's no external console window) and after running the test Test Explorer shows no message, just the test name with an info icon, and Elapsed time 0:00:00.

Ideally there'd be some live output, no matter where, such that when stepping over a failed CHECK this gets shown immediately. Note it's possible I'm missing something here and the output is available, just didn't find it.

JohnnyHendriks commented 2 years ago

Thank you for reaching out. This is actually by design and as far as I know the behavior has always been the same. Information about the test results is collected after the test has been run. In a debugging situation often there will be no information to retrieve as the test executable will typically not be run to completion (at least for my typical use case). Trying to get info anyway, makes things more complicated than they are worth in my opinion. My thinking, typically you run the unittest normally. So you have output from the test at that point. In case of failure, you then may debug the test in which is when you typically use the debugger to get more information.

However, if you also need to look at output created by Catch2, you can still debug the test-executable using the regular way of debugging an executable in Visual Studio, just provide an appropriate commandline to pass to the test-executable to be debugged. Same as you would have done if Test Explorer did not exist I guess.

stinos commented 2 years ago

Ok thanks, makes sense