Skip to content

Commit 34378d2

Browse files
committed
Get coverage working from VS Code.
1 parent e6e5df8 commit 34378d2

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed

.vscode/extensions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"recommendations": [
3-
"ms-dotnettools.csdevkit",
3+
"davidanson.vscode-markdownlint",
44
"editorconfig.editorconfig",
5-
"davidanson.vscode-markdownlint"
5+
"ms-dotnettools.csdevkit"
66
]
77
}

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@
2222
"unconfigured",
2323
"xunit"
2424
],
25+
"coverage-gutters.coverageBaseDir": "artifacts/logs",
26+
"coverage-gutters.coverageFileNames": [
27+
"**/coverage.cobertura.xml"
28+
],
2529
"dotnet.defaultSolution": "Autofac.sln",
2630
"explorer.fileNesting.enabled": true,
2731
"explorer.fileNesting.patterns": {
2832
"*.resx": "$(capture).*.resx, $(capture).designer.cs, $(capture).designer.vb"
2933
},
30-
"omnisharp.enableEditorConfigSupport": true
34+
"files.watcherExclude": {
35+
"**/target": true
36+
}
3137
}

.vscode/tasks.json

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
{
2+
"linux": {
3+
"options": {
4+
"shell": {
5+
"args": [
6+
"-NoProfile",
7+
"-Command"
8+
],
9+
"executable": "pwsh"
10+
}
11+
}
12+
},
13+
"osx": {
14+
"options": {
15+
"shell": {
16+
"args": [
17+
"-NoProfile",
18+
"-Command"
19+
],
20+
"executable": "/usr/local/bin/pwsh"
21+
}
22+
}
23+
},
224
"tasks": [
25+
{
26+
"command": "If (Test-Path ${workspaceFolder}/artifacts/logs) { Remove-Item ${workspaceFolder}/artifacts/logs -Recurse -Force }; New-Item -Path ${workspaceFolder}/artifacts/logs -ItemType Directory -Force | Out-Null",
27+
"label": "create log directory",
28+
"type": "shell"
29+
},
330
{
431
"args": [
532
"build",
@@ -22,10 +49,18 @@
2249
"${workspaceFolder}/Autofac.sln",
2350
"/property:GenerateFullPaths=true",
2451
"/consoleloggerparameters:NoSummary",
52+
"--results-directory",
53+
"\"artifacts/logs\"",
54+
"--logger:trx",
55+
"--collect:\"XPlat Code Coverage\"",
56+
"--settings:build/Coverage.runsettings",
2557
"--filter",
2658
"FullyQualifiedName!~Benchmark"
2759
],
2860
"command": "dotnet",
61+
"dependsOn": [
62+
"create log directory"
63+
],
2964
"group": {
3065
"isDefault": true,
3166
"kind": "test"
@@ -35,5 +70,18 @@
3570
"type": "process"
3671
}
3772
],
38-
"version": "2.0.0"
73+
"version": "2.0.0",
74+
"windows": {
75+
"options": {
76+
"shell": {
77+
"args": [
78+
"-NoProfile",
79+
"-ExecutionPolicy",
80+
"Bypass",
81+
"-Command"
82+
],
83+
"executable": "pwsh.exe"
84+
}
85+
}
86+
}
3987
}

0 commit comments

Comments
 (0)