-
-
Notifications
You must be signed in to change notification settings - Fork 129
Expand file tree
/
Copy pathrun-reflection-tests.ps1
More file actions
47 lines (38 loc) · 1.25 KB
/
Copy pathrun-reflection-tests.ps1
File metadata and controls
47 lines (38 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env pwsh
[CmdletBinding()]
param(
[string]$Framework = "net9.0",
[string]$Configuration = "Release",
[string]$Filter = "/*/*/*/*[EngineTest=Pass]"
)
$ErrorActionPreference = "Stop"
Write-Host "Running Reflection tests..." -ForegroundColor Yellow
# Change to test project directory
$testProjectDir = Join-Path $PSScriptRoot "..\tests\TUnit.TestProject"
if (-not (Test-Path $testProjectDir)) {
Write-Error "Test project directory not found: $testProjectDir"
exit 1
}
Push-Location $testProjectDir
try {
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
dotnet run `
-f $Framework `
--configuration $Configuration `
--treenode-filter $Filter `
--reflection `
--no-build 2>&1 | Out-String | Write-Host
$success = $LASTEXITCODE -eq 0
$stopwatch.Stop()
if ($success) {
Write-Host "Reflection tests PASSED in $($stopwatch.Elapsed)" -ForegroundColor Green
} else {
Write-Host "Reflection tests completed with exit code $LASTEXITCODE in $($stopwatch.Elapsed)" -ForegroundColor Yellow
}
exit $LASTEXITCODE
} catch {
Write-Host "Reflection tests FAILED with error: $_" -ForegroundColor Red
exit 1
} finally {
Pop-Location
}