Skip to content

Commit 929f9ee

Browse files
committed
Include C# 9 tests in CI builds
1 parent e7306b5 commit 929f9ee

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

build/opencover-report.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ $report_folder = '.\OpenCover.Reports'
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"
4343
$target_dll_csharp8 = "..\StyleCop.Analyzers\StyleCop.Analyzers.Test.CSharp8\bin\$Configuration\net472\StyleCop.Analyzers.Test.CSharp8.dll"
44+
$target_dll_csharp9 = "..\StyleCop.Analyzers\StyleCop.Analyzers.Test.CSharp9\bin\$Configuration\net472\StyleCop.Analyzers.Test.CSharp9.dll"
4445

4546
If (Test-Path $report_folder) {
4647
Remove-Item -Recurse -Force $report_folder
@@ -111,6 +112,24 @@ If (($AppVeyor -or $Azure) -and -not $?) {
111112
$exitCode = $LASTEXITCODE
112113
}
113114

115+
&$opencover_console `
116+
-register:$register_mode `
117+
-threshold:1 -oldStyle `
118+
-returntargetcode `
119+
-hideskipped:All `
120+
-filter:"+[StyleCop*]*" `
121+
-excludebyattribute:*.ExcludeFromCodeCoverage* `
122+
-excludebyfile:*\*Designer.cs `
123+
-output:"$report_folder\OpenCover.StyleCopAnalyzers.xml" `
124+
-mergebyhash -mergeoutput `
125+
-target:"$xunit_runner_console_net472" `
126+
-targetargs:"$target_dll_csharp9 -noshadow $AppVeyorArg -xml StyleCopAnalyzers.CSharp9.xunit.xml"
127+
128+
If (($AppVeyor -or $Azure) -and -not $?) {
129+
$host.UI.WriteErrorLine('Build failed; coverage analysis may be incomplete.')
130+
$exitCode = $LASTEXITCODE
131+
}
132+
114133
If (-not $NoReport) {
115134
&$report_generator -targetdir:$report_folder -reports:$report_folder\OpenCover.*.xml
116135
$host.UI.WriteLine("Open $report_folder\index.htm to see code coverage results.")

0 commit comments

Comments
 (0)