Skip to content

Commit 34c2672

Browse files
authored
Merge pull request #3080 from sharwell/continue-tests
Run tests for coverage even if one fails
2 parents aae3085 + d600e0d commit 34c2672

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

build/opencover-report.ps1

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ If ($AppVeyor) {
5656
$register_mode = 'Path32'
5757
}
5858

59+
$exitCode = 0
60+
5961
&$opencover_console `
6062
-register:$register_mode `
6163
-threshold:1 -oldStyle `
@@ -69,8 +71,8 @@ If ($AppVeyor) {
6971
-targetargs:"$target_dll -noshadow $AppVeyorArg -xml StyleCopAnalyzers.xunit.xml"
7072

7173
If (($AppVeyor -or $Azure) -and -not $?) {
72-
$host.UI.WriteErrorLine('Build failed; coverage analysis aborted.')
73-
Exit $LASTEXITCODE
74+
$host.UI.WriteErrorLine('Build failed; coverage analysis may be incomplete.')
75+
$exitCode = $LASTEXITCODE
7476
}
7577

7678
&$opencover_console `
@@ -87,8 +89,8 @@ If (($AppVeyor -or $Azure) -and -not $?) {
8789
-targetargs:"$target_dll_csharp7 -noshadow $AppVeyorArg -xml StyleCopAnalyzers.CSharp7.xunit.xml"
8890

8991
If (($AppVeyor -or $Azure) -and -not $?) {
90-
$host.UI.WriteErrorLine('Build failed; coverage analysis aborted.')
91-
Exit $LASTEXITCODE
92+
$host.UI.WriteErrorLine('Build failed; coverage analysis may be incomplete.')
93+
$exitCode = $LASTEXITCODE
9294
}
9395

9496
&$opencover_console `
@@ -105,11 +107,13 @@ If (($AppVeyor -or $Azure) -and -not $?) {
105107
-targetargs:"$target_dll_csharp8 -noshadow $AppVeyorArg -xml StyleCopAnalyzers.CSharp8.xunit.xml"
106108

107109
If (($AppVeyor -or $Azure) -and -not $?) {
108-
$host.UI.WriteErrorLine('Build failed; coverage analysis aborted.')
109-
Exit $LASTEXITCODE
110+
$host.UI.WriteErrorLine('Build failed; coverage analysis may be incomplete.')
111+
$exitCode = $LASTEXITCODE
110112
}
111113

112114
If (-not $NoReport) {
113115
&$report_generator -targetdir:$report_folder -reports:$report_folder\OpenCover.*.xml
114116
$host.UI.WriteLine("Open $report_folder\index.htm to see code coverage results.")
115117
}
118+
119+
Exit $exitCode

0 commit comments

Comments
 (0)