diff --git a/tools/verify.ps1 b/tools/verify.ps1 index 4903d67..03974a5 100644 --- a/tools/verify.ps1 +++ b/tools/verify.ps1 @@ -25,14 +25,14 @@ try { $record.command = 'unity ' + (($cliArgs | ForEach-Object { '"' + $_ + '"' }) -join ' ') & unity @cliArgs $record.exitCode = $LASTEXITCODE - if ($LASTEXITCODE -ne 0) { throw "Unity $Phase exited $LASTEXITCODE. See $logPath" } - if (!(Test-Path -LiteralPath $xmlPath)) { throw 'Unity did not write a test report.' } + if (!(Test-Path -LiteralPath $xmlPath)) { throw "Unity $Phase exited $($record.exitCode) without a test report. See $logPath" } [xml]$report = Get-Content -LiteralPath $xmlPath -Raw $cases = @($report.SelectNodes('//test-case')) $record.total = $cases.Count $record.passed = @($cases | Where-Object { $_.result -eq 'Passed' }).Count $record.failed = @($cases | Where-Object { $_.result -eq 'Failed' }).Count $record.notPassed = $record.total - $record.passed + if ($record.exitCode -ne 0) { throw "Unity $Phase exited $($record.exitCode). See $logPath" } if ($record.total -eq 0 -or $record.notPassed -ne 0) { throw "Test report contains $($record.total) tests and $($record.notPassed) non-passing cases." } } elseif ($Phase -eq 'AndroidBuild') { New-Item -ItemType Directory -Path (Split-Path $apkPath -Parent) -Force | Out-Null