-
-
Notifications
You must be signed in to change notification settings - Fork 260
/
coverage.ps1
22 lines (17 loc) · 903 Bytes
/
coverage.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Define the location of the xml report and html report.
$coverageDir = "$PSScriptRoot\artifacts\coverage"
$coverageReport = "$coverageDir\coverage.xml"
# Quote arguments for the commandline.
$testAssemblyArgs = "`"$PSScriptRoot\SharpShell.Tests\bin\Release\SharpShell.Tests.dll`""
$workArgs = "`"$PSScriptRoot\artifacts\tests`""
# Create an artifacts directory and build the report.
New-Item -ItemType Directory -Force -Path "$PSScriptRoot\artifacts\coverage"
OpenCover.Console.exe "-target:nunit3-console.exe" `
-targetargs:"$testAssemblyArgs --work=$workArgs" `
"-filter:+[SharpShell*]* -[SharpShell.Tests*]*" `
"-register:user" `
"-output:$coverageReport"
# Create a local report.
reportgenerator "-reports:$coverageReport" "-targetdir:$coverageDir\html"
# Upload the report to codecov. The CODECOV_TOKEN env var must be set.
codecov -f "$coverageReport"