Files
MaaAssistantArknights/tools/SmokeTesting/run_tests.ps1
MistEO 51ab24945b refactor: 依赖大更新 (#13908)
Co-authored-by: status102 <102887808+status102@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-08 21:17:47 +08:00

46 lines
1.1 KiB
PowerShell

$clients = @("Official", "YostarJP", "YostarEN", "YostarKR", "txwy")
$jobs = @()
$error_client = @()
New-Item -Path "./install/debug" -ItemType Directory -Force -ErrorAction SilentlyContinue > $null
foreach ($client in $clients) {
$jobs += Start-Job -ScriptBlock {
param ($client)
./install/smoke_test.exe $client > "./install/debug/asst_$client.log"
if ($LASTEXITCODE -ne 0) {
return $client
}
} -ArgumentList $client
}
foreach ($job in $jobs) {
$result = Receive-Job -Job $job -Wait
Remove-Job -Job $job
if ($result) {
$error_client += $result
}
}
Remove-Item ./install/debug/asst.log -ErrorAction SilentlyContinue
foreach ($client in $clients) {
Get-Content ./install/debug/asst_$client.log | Add-Content ./install/debug/asst.log
}
if ($error_client.Count -gt 0) {
$pattern = "[ERR]"
foreach ($client in $error_client) {
Get-Content ./install/debug/asst_$client.log | ForEach-Object {
if ($_ -match $pattern) {
Write-Host $_ -ForegroundColor DarkRed
} else {
Write-Host $_
}
}
}
exit 1
}
Write-Host "All tests passed" -ForegroundColor Green