-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcoverage.ps1
More file actions
16 lines (13 loc) · 742 Bytes
/
coverage.ps1
File metadata and controls
16 lines (13 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
dotnet tool install -g dotnet-reportgenerator-globaltool
dotnet tool update -g dotnet-reportgenerator-globaltool
$dir = "$pwd\ChocolateStoreCoreTests"
$license = [System.Environment]::GetEnvironmentVariable('license', 'Machine')
Remove-Item -Recurse -Force $dir/coveragereport/
Remove-Item -Recurse -Force $dir/TestResults/
if (!(Test-Path -path $dir/CoverageHistory)) {
New-Item -ItemType directory -Path $dir/CoverageHistory
}
dotnet test --collect:"XPlat Code Coverage"
reportgenerator -reports:"$dir\**\coverage.cobertura.xml" -targetdir:"$dir\coveragereport" -reporttypes:Html -historydir:$dir/CoverageHistory -license:"$license"
$osInfo = Get-CimInstance -ClassName Win32_OperatingSystem
(& "$dir/coveragereport/index.html")