forked from huluvu21/kontent-delivery-sdk-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coverage.ps1
15 lines (10 loc) · 804 Bytes
/
coverage.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$buildConfig = if ($ENV:CONFIGURATION -eq $null) { "Release" } else { $ENV:CONFIGURATION }
$buildFolder = if ($ENV:APPVEYOR_BUILD_FOLDER -eq $null) { $PSScriptRoot } else { $ENV:APPVEYOR_BUILD_FOLDER }
$openCover = 'C:\ProgramData\chocolatey\lib\opencover.portable\tools\OpenCover.Console.exe'
dotnet test
$target = '-target:C:\Program Files\dotnet\dotnet.exe'
$targetArgs = '-targetargs:"test -c:' + $buildConfig + ' --logger:trx;LogFileName=results.trx /p:DebugType=full"'
$filter = '-filter:+[Kentico.Kontent.Delivery*]*-[*Tests]*'
$output = '-output:' + $buildFolder + '\coverage.xml'
$register = if ($ENV:APPVEYOR -eq $true ) { '-register' } else { '-register:user' } # Magical parameter that breaks things
& $openCover $target $targetArgs $filter $register '-oldStyle' '-mergeoutput' $output