swiftlang / vscode-swift

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

Use native VSCode coverage APIs, cover swift-testing tests #807

Closed plemarquand closed 1 month ago

plemarquand commented 1 month ago

Move to the new VSCode coverage APIs that were introduced in VSCode version 1.88. This allows us to remove the coverage renderer and coverage report files. This functionality is now built in to the test explorer and VSCode's document rendering.

This patch also adds support for producing test coverage from swift-testing tests. XCTests and swift-testing tests are each run in their respective binaries and then the coverage data is merged into a profdata file before being exported to LCOV format.

Finally we transform the LCOV JSON into the coverage structures for VSCode and associate this data with the test run.

plemarquand commented 1 month ago

@adam-fowler thanks for taking such a thorough look. I think everything should be addressed.