@@ -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
4445If (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'
5052mkdir $symbols_folder | Out-Null
5153mkdir $symbols_folder_csharp6 | Out-Null
5254mkdir $symbols_folder_csharp7 | Out-Null
55+ mkdir $symbols_folder_csharp8 | Out-Null
5356
5457function Convert-Coverage-Pdb () {
5558 param (
@@ -98,6 +101,10 @@ $target_dir = [IO.Path]::GetDirectoryName($target_dll_csharp7)
98101Get-ChildItem $target_dir - Filter * .dll | Foreach-Object { Convert-Coverage - Pdb - assembly $_.FullName - outputDir $symbols_folder_csharp7 }
99102Get-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+
101108If (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+
148174If (-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