feat(diagnostic): 阶段 0A 输入链路被动探测与线程归属复现
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
param(
|
||||
[ValidateSet('Debug', 'Release')]
|
||||
[string]$Configuration = 'Debug',
|
||||
[ValidateSet('x64', 'Win32')]
|
||||
[string]$Platform = 'x64'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$probe = Join-Path $root "build\$Platform\$Configuration\EasyX.ThreadProbe.exe"
|
||||
if (-not (Test-Path -LiteralPath $probe)) {
|
||||
throw "Thread probe not built: $probe"
|
||||
}
|
||||
|
||||
$resultRoot = Join-Path $root 'TestResults\easyx-thread-probe'
|
||||
New-Item -ItemType Directory -Force -Path $resultRoot | Out-Null
|
||||
$resultPath = Join-Path $resultRoot ((Get-Date -Format 'yyyyMMdd-HHmmss-fff') + "-$PID.json")
|
||||
|
||||
& $probe $resultPath
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "EasyX thread probe failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath $resultPath)) {
|
||||
throw "Thread probe result not found: $resultPath"
|
||||
}
|
||||
|
||||
$result = Get-Content -Raw -LiteralPath $resultPath | ConvertFrom-Json
|
||||
if (-not $result.completed) {
|
||||
throw "Thread probe did not complete: $resultPath"
|
||||
}
|
||||
|
||||
$result | Add-Member -NotePropertyName resultPath -NotePropertyValue $resultPath
|
||||
$result
|
||||
Reference in New Issue
Block a user