swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
705 stars 47 forks source link

Have separate debug consoles for xctest and swift-testing #902

Closed award999 closed 2 weeks ago

award999 commented 2 weeks ago

Right now if you run debug on all tests the swift-testing tests run first then the xctests. Because the 2 debug sessions seem to have the same name, the swift-testing debug console gets cleared when the xctests start to run. In the past I've noticed if 2 debug sessions have different names, they both stick around and you can use the dropdown selector to switch between them.

Since the test run output is empty for debug sessions, it becomes more crucial to be able to see the output for both test runs, and so you can see any print statements for debugging

plemarquand commented 2 weeks ago

This looks implementable, with the caveat that VS Code doesn't seem to have an API to remove an old session with a different name from the dropdown.

Specifically, if we do a debugging run of all tests in a XCTest+Swift Testing project this creates two sessions with, for instance, the names "XCTest" and "Swift Testing". However if then we run a single XCTest the "XCTest" debug session is updated but the old "Swift Testing" session sticks around in the dropdown with the output from the last run.

award999 commented 1 week ago

Verified with b461f8f