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' } & 'C:\Python314\python.exe' tools\tests\prepare_clover_fixtures.py if ($LASTEXITCODE -ne 0) { throw 'Clover 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 }