2026-10-17 23:38:49 +03:00
|
|
|
|
# Дымовая проверка установленного дерева (результат cmake --install) на Windows.
|
2026-10-12 13:14:08 +03:00
|
|
|
|
#
|
|
|
|
|
|
# powershell -File tests\scripts\smoke_installed.ps1 -Prefix C:\r\bl-smoke-stage
|
|
|
|
|
|
#
|
|
|
|
|
|
# Проверяет, что windeployqt положил всё нужное (DLL Qt, плагины платформ и QML),
|
|
|
|
|
|
# лаунчер запускается без окна и через 10 секунд ещё жив, а в логе нет ошибок
|
|
|
|
|
|
# загрузки модулей.
|
|
|
|
|
|
#
|
2026-10-13 08:51:07 +03:00
|
|
|
|
# QDir::homePath() на Windows берёт профиль у системы и USERPROFILE не читает,
|
|
|
|
|
|
# поэтому лаунчер запускается с BILAUNCHER_HOME на временную папку (см.
|
|
|
|
|
|
# launcherpaths.h) — настоящая %APPDATA%\BiLauncher раннера не трогается.
|
2026-10-12 13:14:08 +03:00
|
|
|
|
|
|
|
|
|
|
param(
|
|
|
|
|
|
[Parameter(Mandatory = $true)][string]$Prefix,
|
|
|
|
|
|
[int]$RunSeconds = 10
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
|
function Fail($message) { Write-Host "SMOKE FAIL: $message"; exit 1 }
|
|
|
|
|
|
|
|
|
|
|
|
$bin = Join-Path $Prefix "bin\BiLauncher.exe"
|
|
|
|
|
|
if (-not (Test-Path $bin)) { Fail "нет $bin" }
|
|
|
|
|
|
foreach ($required in @("bin\Qt6Core.dll", "bin\Qt6Quick.dll", "bin\Qt6Network.dll",
|
|
|
|
|
|
"bin\platforms\qwindows.dll", "bin\qml\QtQuick\Controls")) {
|
|
|
|
|
|
if (-not (Test-Path (Join-Path $Prefix $required))) { Fail "нет $required" }
|
|
|
|
|
|
}
|
|
|
|
|
|
if (-not (Get-ChildItem (Join-Path $Prefix "bin\tls") -Filter "*.dll" -ErrorAction SilentlyContinue)) {
|
|
|
|
|
|
Fail "нет TLS-плагина (bin\tls) — лаунчер не сможет ходить по https"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-10-13 08:51:07 +03:00
|
|
|
|
$realProfile = Join-Path $env:APPDATA "BiLauncher"
|
|
|
|
|
|
$realExisted = Test-Path $realProfile
|
2026-10-12 13:14:08 +03:00
|
|
|
|
|
2026-10-13 08:51:07 +03:00
|
|
|
|
$sandbox = Join-Path $env:TEMP ("bilauncher-smoke-" + [guid]::NewGuid().ToString("N"))
|
|
|
|
|
|
$log = Join-Path $sandbox "log"
|
2026-10-12 13:14:08 +03:00
|
|
|
|
New-Item -ItemType Directory -Force $log | Out-Null
|
|
|
|
|
|
$stdout = Join-Path $log "stdout.log"
|
|
|
|
|
|
$stderr = Join-Path $log "stderr.log"
|
2026-10-13 08:51:07 +03:00
|
|
|
|
$profileRoot = Join-Path $sandbox "AppData\Roaming\BiLauncher"
|
2026-10-12 13:14:08 +03:00
|
|
|
|
|
2026-10-13 08:51:07 +03:00
|
|
|
|
$env:BILAUNCHER_HOME = $sandbox
|
2026-10-12 13:14:08 +03:00
|
|
|
|
$env:QT_QPA_PLATFORM = "offscreen"
|
|
|
|
|
|
$env:QT_FORCE_STDERR_LOGGING = "1"
|
|
|
|
|
|
$env:QTWEBENGINE_CHROMIUM_FLAGS = "--disable-gpu"
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
$process = Start-Process -FilePath $bin -PassThru -NoNewWindow `
|
|
|
|
|
|
-RedirectStandardOutput $stdout -RedirectStandardError $stderr
|
|
|
|
|
|
Start-Sleep -Seconds $RunSeconds
|
|
|
|
|
|
$alive = -not $process.HasExited
|
|
|
|
|
|
if ($alive) { Stop-Process -Id $process.Id -Force; $process.WaitForExit(5000) | Out-Null }
|
|
|
|
|
|
|
|
|
|
|
|
$text = ""
|
|
|
|
|
|
if (Test-Path $stderr) { $text += Get-Content $stderr -Raw }
|
|
|
|
|
|
if (Test-Path $stdout) { $text += Get-Content $stdout -Raw }
|
|
|
|
|
|
Write-Host "----- лог запуска -----"
|
|
|
|
|
|
Write-Host $text
|
|
|
|
|
|
|
|
|
|
|
|
if (-not $alive) { Fail "лаунчер завершился раньше чем через $RunSeconds с (код $($process.ExitCode))" }
|
|
|
|
|
|
if ($text -match "is not installed|Cannot load library|could not find the Qt platform plugin|QQmlApplicationEngine failed") {
|
|
|
|
|
|
Fail "в логе ошибки загрузки модулей"
|
|
|
|
|
|
}
|
|
|
|
|
|
if (-not (Test-Path (Join-Path $profileRoot "settings.json"))) { Fail "лаунчер не создал $profileRoot\settings.json" }
|
2026-10-13 08:51:07 +03:00
|
|
|
|
if (-not $realExisted -and (Test-Path $realProfile)) { Fail "лаунчер создал настоящую $realProfile мимо BILAUNCHER_HOME" }
|
2026-10-12 13:14:08 +03:00
|
|
|
|
Write-Host "SMOKE OK: $bin"
|
|
|
|
|
|
}
|
|
|
|
|
|
finally {
|
2026-10-13 08:51:07 +03:00
|
|
|
|
Remove-Item -Recurse -Force $sandbox -ErrorAction SilentlyContinue
|
2026-10-12 13:14:08 +03:00
|
|
|
|
}
|