-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMeasure-Coverage.ps1
More file actions
24 lines (20 loc) · 840 Bytes
/
Copy pathMeasure-Coverage.ps1
File metadata and controls
24 lines (20 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env pwsh
$currentDir = Get-Location
try {
Set-Location $PSScriptRoot
# install reportgenerator if not installed
if(dotnet tool list --tool-path .dotnet/ `
| Select-String dotnet-reportgenerator-globaltool) {
}
else {
dotnet tool install dotnet-reportgenerator-globaltool --tool-path .dotnet/
}
# remove old test report
Get-ChildItem -Directory src/*.Test*/TestResults/* | Remove-Item -Recurse
# test and measure coverage
dotnet test src/SmartVectorDotNet.slnx --collect:"XPlat Code Coverage" --settings src/etc/coverlet.runsettings
# export HTML coverage report
&./.dotnet/reportgenerator -reports:"src/*.Test*/TestResults/*/coverage.cobertura.xml" -targetdir:".CodeCoverage" -reporttypes:Html
} finally {
Set-Location $currentDir
}