Skip to content

Commit 3b04c8f

Browse files
Add support for code coverage plugin "Coverage Gutter" in Visual Studio Code
1 parent 410c8e9 commit 3b04c8f

File tree

7 files changed

+25
-3
lines changed

7 files changed

+25
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/*.xcodeproj
55
lambda.zip
66
swift-shared-libs
7+
default.profraw

Examples/HTTPSRequest/.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"name": "Test",
2121
"args": [],
2222
"cwd": "${workspaceFolder}",
23-
"preLaunchTask": "test"
23+
"preLaunchTask": "codecov"
2424
}
2525
]
2626
}

Examples/HTTPSRequest/.vscode/tasks.json

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
"command": "swift test --enable-code-coverage || true",
1919
"group": "test"
2020
},
21+
{
22+
"label": "codecov",
23+
"type": "shell",
24+
"command": "llvm-cov export ${workspaceFolder}/.build/x86_64-unknown-linux/debug/HTTPSRequest -instr-profile=${workspaceFolder}/.build/x86_64-unknown-linux/debug/codecov/default.profdata -format=lcov > ${workspaceFolder}/.build/x86_64-unknown-linux/debug/codecov/lcov.info",
25+
"group": "test",
26+
"dependsOn":["test"]
27+
},
2128
{
2229
"label": "run",
2330
"type": "shell",

Examples/HelloWorld/.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"name": "Test",
2121
"args": [],
2222
"cwd": "${workspaceFolder}",
23-
"preLaunchTask": "test"
23+
"preLaunchTask": "codecov"
2424
}
2525
]
2626
}

Examples/HelloWorld/.vscode/tasks.json

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
"command": "swift test --enable-code-coverage || true",
1919
"group": "test"
2020
},
21+
{
22+
"label": "codecov",
23+
"type": "shell",
24+
"command": "llvm-cov export ${workspaceFolder}/.build/x86_64-unknown-linux/debug/HelloWorld -instr-profile=${workspaceFolder}/.build/x86_64-unknown-linux/debug/codecov/default.profdata -format=lcov > ${workspaceFolder}/.build/x86_64-unknown-linux/debug/codecov/lcov.info",
25+
"group": "test",
26+
"dependsOn":["test"]
27+
},
2128
{
2229
"label": "run",
2330
"type": "shell",

Examples/S3Test/.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"name": "Test",
2222
"args": [],
2323
"cwd": "${workspaceFolder}",
24-
"preLaunchTask": "test"
24+
"preLaunchTask": "codecov"
2525
}
2626
]
2727
}

Examples/S3Test/.vscode/tasks.json

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
"command": "swift test --enable-code-coverage || true",
1919
"group": "test"
2020
},
21+
{
22+
"label": "codecov",
23+
"type": "shell",
24+
"command": "llvm-cov export ${workspaceFolder}/.build/x86_64-unknown-linux/debug/S3Test -instr-profile=${workspaceFolder}/.build/x86_64-unknown-linux/debug/codecov/default.profdata -format=lcov > ${workspaceFolder}/.build/x86_64-unknown-linux/debug/codecov/lcov.info",
25+
"group": "test",
26+
"dependsOn":["test"]
27+
},
2128
{
2229
"label": "run",
2330
"type": "shell",

0 commit comments

Comments
 (0)