Files
stevanfreeborn.atproto.iden…/scripts/test.ps1
T

36 lines
996 B
PowerShell
Raw Normal View History

$RepoRoot = Resolve-Path (Join-Path -Path $PSScriptRoot -ChildPath "..")
2026-08-27 16:31:11 -05:00
Push-Location -Path $RepoRoot
2026-08-27 16:31:11 -05:00
try {
Write-Host "Starting test execution..." -ForegroundColor Magenta
Write-Host ""
2026-08-27 16:31:11 -05:00
$TestResultsPath = Join-Path -Path $RepoRoot -ChildPath "TestResults"
2026-08-27 16:31:11 -05:00
if (Test-Path $TestResultsPath) {
Remove-Item -Path $TestResultsPath -Recurse -Force
}
2026-08-27 16:31:11 -05:00
dotnet test
2026-08-27 16:31:11 -05:00
$TestExitCode = $LASTEXITCODE
if ($TestExitCode -eq 0) {
Write-Host ""
Write-Host "Tests passed. Generating code coverage HTML report..." -ForegroundColor Magenta
Write-Host ""
reportgenerator -reports:"**/*.cobertura.xml" -targetdir:"CoverageReport" -filefilters:"-*.g.cs"
Write-Host ""
Write-Host "SUCCESS: All tests passed and coverage report generated." -ForegroundColor Green
} else {
Write-Host "FAILURE: Tests failed with exit code $TestExitCode. Skipping coverage report generation." -ForegroundColor Red
}
}
finally {
Pop-Location
2026-08-27 16:31:11 -05:00
}
exit $TestExitCode