wincmd/scripts/run_windows_tests.ps1
starainrt 7e6cc73106
完善 Windows 运维封装与 NTFS 索引解析
- 新增自启动幂等配置、统一错误语义、进程等待和进程树终止能力
- 增强服务生命周期管理,支持等待状态、重启、幂等创建和配置更新
- 新增 NTFS 卷索引、文件 ID 解析、文件遍历、USN 变更监听和 bookmark 持久化
- 修复 NTFS boot sector、fragment、MFT、USN 解析边界和路径重建问题
- 补充权限、进程、服务、NTFS 解析和工作流回归测试
- 增加 Windows 测试脚本和管理员 NTFS smoke 验证脚本
- 升级 Go 兼容版本到 1.18,并更新 stario、win32api 及相关间接依赖
2026-06-09 15:59:31 +08:00

37 lines
883 B
PowerShell

param(
[string[]]$Packages = @('.', './ntfs/usn'),
[switch]$KeepArtifacts
)
$ErrorActionPreference = 'Stop'
$repo = Resolve-Path (Join-Path $PSScriptRoot '..')
$tmpDir = Join-Path $repo '.tmp_test'
New-Item -ItemType Directory -Force -Path $tmpDir | Out-Null
Set-Location $repo
foreach ($pkg in $Packages) {
$name = ($pkg -replace '[^A-Za-z0-9_.-]', '_').Trim('_')
if ([string]::IsNullOrWhiteSpace($name) -or $name -eq '.') {
$name = 'root'
}
$exe = Join-Path $tmpDir ("$name.test.exe")
Write-Host "[build] $pkg -> $exe"
go test $pkg -c -o $exe
if ($LASTEXITCODE -ne 0) {
throw "go test -c failed for package $pkg"
}
Write-Host "[run] $pkg"
& $exe --% -test.v
if ($LASTEXITCODE -ne 0) {
throw "test executable failed for package $pkg"
}
}
if (-not $KeepArtifacts) {
Remove-Item $tmpDir -Recurse -Force -ErrorAction SilentlyContinue
}