Take root verification evidence improvement

This commit is contained in:
NINI
2026-10-05 01:38:47 +09:00
+2 -2
View File
@@ -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