Skip to content

Commit 8528725

Browse files
committed
Updated opencover-report.ps1
1 parent e44a57a commit 8528725

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

build/opencover-report.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,19 @@ $report_folder = '.\OpenCover.Reports'
4040
$symbols_folder = '.\OpenCover.Symbols'
4141
$target_dll = "..\StyleCop.Analyzers\StyleCop.Analyzers.Test\bin\$Configuration\net452\StyleCop.Analyzers.Test.dll"
4242
$target_dll_csharp7 = "..\StyleCop.Analyzers\StyleCop.Analyzers.Test.CSharp7\bin\$Configuration\net46\StyleCop.Analyzers.Test.CSharp7.dll"
43+
$target_dll_csharp8 = "..\StyleCop.Analyzers\StyleCop.Analyzers.Test.CSharp8\bin\$Configuration\net472\StyleCop.Analyzers.Test.CSharp8.dll"
4344

4445
If (Test-Path $symbols_folder) {
4546
Remove-Item -Recurse -Force $symbols_folder
4647
}
4748

4849
$symbols_folder_csharp6 = Join-Path $symbols_folder 'CSharp6'
4950
$symbols_folder_csharp7 = Join-Path $symbols_folder 'CSharp7'
51+
$symbols_folder_csharp8 = Join-Path $symbols_folder 'CSharp8'
5052
mkdir $symbols_folder | Out-Null
5153
mkdir $symbols_folder_csharp6 | Out-Null
5254
mkdir $symbols_folder_csharp7 | Out-Null
55+
mkdir $symbols_folder_csharp8 | Out-Null
5356

5457
function Convert-Coverage-Pdb() {
5558
param (
@@ -98,6 +101,10 @@ $target_dir = [IO.Path]::GetDirectoryName($target_dll_csharp7)
98101
Get-ChildItem $target_dir -Filter *.dll | Foreach-Object { Convert-Coverage-Pdb -assembly $_.FullName -outputDir $symbols_folder_csharp7 }
99102
Get-ChildItem $target_dir -Filter *.dll | Foreach-Object { Extract-Coverage-Pdb -assembly $_.FullName -outputDir $symbols_folder_csharp7 }
100103

104+
$target_dir = [IO.Path]::GetDirectoryName($target_dll_csharp8)
105+
Get-ChildItem $target_dir -Filter *.dll | Foreach-Object { Convert-Coverage-Pdb -assembly $_.FullName -outputDir $symbols_folder_csharp8 }
106+
Get-ChildItem $target_dir -Filter *.dll | Foreach-Object { Extract-Coverage-Pdb -assembly $_.FullName -outputDir $symbols_folder_csharp8 }
107+
101108
If (Test-Path $report_folder) {
102109
Remove-Item -Recurse -Force $report_folder
103110
}
@@ -145,6 +152,25 @@ If ($AppVeyor -and -not $?) {
145152
Exit $LASTEXITCODE
146153
}
147154

155+
&$opencover_console `
156+
-register:user `
157+
-threshold:1 -oldStyle `
158+
-returntargetcode `
159+
-hideskipped:All `
160+
-filter:"+[StyleCop*]*" `
161+
-excludebyattribute:*.ExcludeFromCodeCoverage* `
162+
-excludebyfile:*\*Designer.cs `
163+
-searchdirs:"$symbols_folder_csharp8" `
164+
-output:"$report_folder\OpenCover.StyleCopAnalyzers.xml" `
165+
-mergebyhash -mergeoutput `
166+
-target:"$xunit_runner_console" `
167+
-targetargs:"$target_dll_csharp8 -noshadow $AppVeyorArg"
168+
169+
If ($AppVeyor -and -not $?) {
170+
$host.UI.WriteErrorLine('Build failed; coverage analysis aborted.')
171+
Exit $LASTEXITCODE
172+
}
173+
148174
If (-not $NoReport) {
149175
&$report_generator -targetdir:$report_folder -reports:$report_folder\OpenCover.*.xml
150176
$host.UI.WriteLine("Open $report_folder\index.htm to see code coverage results.")

0 commit comments

Comments
 (0)