Skip to content

Commit 4fafa93

Browse files
committed
Use native VSCode coverage APIs, cover swift-testing
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.
1 parent 275ed7f commit 4fafa93

File tree

11 files changed

+440
-855
lines changed

11 files changed

+440
-855
lines changed

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/swift-server/vscode-swift"
1111
},
1212
"engines": {
13-
"vscode": "^1.71.0"
13+
"vscode": "^1.88.0"
1414
},
1515
"categories": [
1616
"Programming Languages",
@@ -447,47 +447,6 @@
447447
}
448448
}
449449
},
450-
{
451-
"title": "Test Coverage",
452-
"properties": {
453-
"swift.coverage.displayReportAfterRun": {
454-
"type": "boolean",
455-
"default": true,
456-
"description": "Should test coverage report be shown after running tests",
457-
"order": 1
458-
},
459-
"swift.coverage.alwaysShowStatusItem": {
460-
"type": "boolean",
461-
"default": true,
462-
"description": "Always show the test coverage status item. If this is set to true the status item can be clicked on to toggle test coverage display on and off.",
463-
"order": 2
464-
},
465-
"swift.coverage.colors.lightMode.hit": {
466-
"type": "string",
467-
"default": "#c0ffc0",
468-
"description": "Light mode theme background color for line of code hit during test coverage.",
469-
"order": 3
470-
},
471-
"swift.coverage.colors.lightMode.miss": {
472-
"type": "string",
473-
"default": "#ffc0c0",
474-
"description": "Light mode theme background color for line of code missed during test coverage.",
475-
"order": 4
476-
},
477-
"swift.coverage.colors.darkMode.hit": {
478-
"type": "string",
479-
"default": "#003000",
480-
"description": "Dark mode theme background color for line of code hit during test coverage.",
481-
"order": 5
482-
},
483-
"swift.coverage.colors.darkMode.miss": {
484-
"type": "string",
485-
"default": "#400000",
486-
"description": "Dark mode theme background color for line of code missed during test coverage.",
487-
"order": 6
488-
}
489-
}
490-
},
491450
{
492451
"title": "Debugger",
493452
"properties": {
@@ -1170,7 +1129,7 @@
11701129
"@types/mocha": "^10.0.1",
11711130
"@types/node": "^18.19.33",
11721131
"@types/plist": "^3.0.5",
1173-
"@types/vscode": "^1.71.0",
1132+
"@types/vscode": "^1.88.0",
11741133
"@typescript-eslint/eslint-plugin": "^7.8.0",
11751134
"@typescript-eslint/parser": "^7.8.0",
11761135
"@vscode/test-electron": "^2.3.8",

0 commit comments

Comments
 (0)