Files
QFT/VERIFY_WINDOWS_HOST.ps1
T
2026-08-11 13:49:27 +08:00

44 lines
1.8 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
Write-Host "== QFT v0.4.7 Windows host verification ==" -ForegroundColor Cyan
if (Get-Command python -ErrorAction SilentlyContinue) {
Write-Host "[1/4] Core protocol/selftests"
& python "$Root\scripts\run_all_selftests.py"
if ($LASTEXITCODE -ne 0) {
Write-Host "If Python reports missing qrcode/cv2, run: python -m pip install -r `"$Root\scripts\requirements-test.txt`"" -ForegroundColor Yellow
throw "repository Python selftests failed"
}
} else {
Write-Warning "python not found; skipping repository Python selftests"
}
Write-Host "[2/4] Windows Rust compile/test/release"
Push-Location "$Root\windows"
try {
& cargo check
if ($LASTEXITCODE -ne 0) { throw "cargo check failed" }
& cargo test
if ($LASTEXITCODE -ne 0) { throw "cargo test failed" }
& cargo build --release
if ($LASTEXITCODE -ne 0) { throw "cargo build --release failed" }
} finally { Pop-Location }
Write-Host "[3/4] Android unit/build"
Push-Location "$Root\android"
try {
if (!(Test-Path '.\gradle\wrapper\gradle-wrapper.jar')) {
Write-Host "Gradle wrapper jar missing; attempting bootstrap..."
& powershell -ExecutionPolicy Bypass -File '.\bootstrap-wrapper.ps1'
}
& .\gradlew.bat :app:testDebugUnitTest :app:assembleDebug --stacktrace
if ($LASTEXITCODE -ne 0) { throw "Android Gradle verification failed" }
} finally { Pop-Location }
Write-Host "[4/4] Artifact locations" -ForegroundColor Cyan
Write-Host "Windows EXE: $Root\windows\target\release\qft-windows.exe"
Write-Host "Android APK: $Root\android\app\build\outputs\apk\debug\app-debug.apk"
Write-Host "`nHOST BUILD VERIFICATION PASSED" -ForegroundColor Green
Write-Host "Next: perform the physical display/camera and Wi-Fi Direct acceptance matrix in TEST_REPORT.md."