KAZIK/tools/tests/test_casino_actions.ps1
Artvasil09 3ad5bf4c9d Develop assembly-only casino scenes and native games
Add native Durak, poker, blackjack, roulette, Buckshot and billiards scenes with animation assets and regression tests. Improve arrival, city, hall, profiles, shops, audio and exit handling; remove the portable C game core and refresh shipping executables.
2026-10-08 22:39:19 +03:00

28 lines
1.8 KiB
PowerShell

param([string]$MasmRoot = 'F:\MASM32\masm32', [switch]$SkipPreview)
$ErrorActionPreference = 'Stop'
$root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path
Push-Location $root
try {
New-Item -ItemType Directory -Path 'build\actions' -Force | Out-Null
& 'C:\Python314\python.exe' tools\tests\prepare_arrival_fixtures.py
if ($LASTEXITCODE -ne 0) { throw 'Profile test fixture preparation failed' }
& "$MasmRoot\bin\ml.exe" /c /coff /Cp /nologo /I. /DCASINO_ACTION_TEST=1 /Fobuild\actions\actions-test.obj poker.asm
if ($LASTEXITCODE -ne 0) { throw 'Action test assembly failed' }
$sdkRoot = Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\10\Lib'
$sdk = Get-ChildItem -LiteralPath $sdkRoot -Directory -ErrorAction SilentlyContinue |
Sort-Object Name -Descending |
Where-Object { Test-Path -LiteralPath (Join-Path $_.FullName 'um\x86\kernel32.lib') } |
Select-Object -First 1
$libraries = @()
if ($sdk) { $libraries += '/LIBPATH:' + (Join-Path $sdk.FullName 'um\x86') }
$libraries += "/LIBPATH:$MasmRoot\lib"
& "$MasmRoot\bin\link.exe" /nologo /SUBSYSTEM:CONSOLE /RELEASE @libraries /OUT:build\actions\actions-test.exe build\actions\actions-test.obj kernel32.lib winmm.lib user32.lib ws2_32.lib gdi32.lib
if ($LASTEXITCODE -ne 0) { throw 'Action test link failed' }
if (!$SkipPreview) {
& "$MasmRoot\bin\link.exe" /nologo /SUBSYSTEM:WINDOWS /RELEASE @libraries /OUT:build\actions\buckshot-preview.exe build\actions\actions-test.obj kernel32.lib winmm.lib user32.lib ws2_32.lib gdi32.lib
if ($LASTEXITCODE -ne 0) { throw 'Buckshot preview link failed' }
}
& .\build\actions\actions-test.exe
if ($LASTEXITCODE -ne 0) { throw "Action test assertion failed: $LASTEXITCODE" }
Get-Content -LiteralPath 'build\actions\test-report.txt'
} finally { Pop-Location }