KAZIK/tools/tests/test_buckshot_paths.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

30 lines
1.7 KiB
PowerShell

param(
[string]$MasmRoot = 'F:\MASM32\masm32',
[string]$GameObject = 'build\graphics\poker.obj'
)
$ErrorActionPreference = 'Stop'
$root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path
Push-Location $root
try {
& "$MasmRoot\bin\ml.exe" /c /coff /Cp /nologo "/I$MasmRoot\include" /Fobuild\actions\buckshot-path.obj tools\tests\buckshot_path_probe.asm
if ($LASTEXITCODE -ne 0) { throw 'Asset path probe assembly failed' }
$sdkRoot = Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\10\Lib'
$sdk = Get-ChildItem -LiteralPath $sdkRoot -Directory |
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 /ENTRY:RunBuckshotPathProbe@0 @libraries /OUT:build\actions\buckshot-path-test.exe build\actions\buckshot-path.obj $GameObject kernel32.lib winmm.lib user32.lib ws2_32.lib gdi32.lib
if ($LASTEXITCODE -ne 0) { throw 'Asset path probe link failed' }
$probe = Join-Path $root 'build\actions\buckshot-path-test.exe'
foreach ($directory in @($root, [IO.Path]::GetTempPath())) {
Push-Location $directory
try {
& $probe
if ($LASTEXITCODE -ne 0) { throw "Buckshot assets failed to load from working directory $directory" }
} finally { Pop-Location }
}
Write-Output 'PASS: shipping loaders find all twelve Buckshot packs and the first-person revolver packs from root/TEMP'
} finally { Pop-Location }