param([string]$Executable=(Join-Path $PSScriptRoot '../Demon_v0.19_Windows/Demon.exe')) $ErrorActionPreference='Stop' $repo=Split-Path -Parent $PSScriptRoot $engine=(Resolve-Path -LiteralPath $Executable).Path $cases=[ordered]@{economy='--test-economy';tests='--test-mode';ui='--test-ui';sentences='--test-sentences';hud='--test-hud';gait='--test-gait';posture='--test-posture';visuals='--test-visuals';audio='--test-audio';exit='--test-exit';capture='--capture-economy';probe='--probe-build'} foreach($name in $cases.Keys){ $log=Join-Path $repo ('qa_v19/release-'+$name+'.log') $run=Start-Process -FilePath $engine -WorkingDirectory (Split-Path -Parent $engine) -ArgumentList @('--log-file',('"'+$log+'"'),'--',$cases[$name]) -WindowStyle Hidden -PassThru if(-not $run.WaitForExit(240000)){$run.Kill();throw ($name+' exceeded four minutes')} $run.Refresh() Write-Output ($name+': exit '+$run.ExitCode) Get-Content -LiteralPath $log -Tail 9 if($run.ExitCode -ne 0){throw ($name+' failed')} if(Select-String -LiteralPath $log -Pattern 'ERROR:|Assertion failed|QA check failed' -Quiet){throw ($name+' logged an error')} }