-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun-tests.ps1
More file actions
49 lines (38 loc) · 993 Bytes
/
run-tests.ps1
File metadata and controls
49 lines (38 loc) · 993 Bytes
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
48
49
#!/usr/bin/env pwsh
# Script to run tests on Windows with proper filtering
param(
[string]$Filter = "",
[switch]$Verbose,
[switch]$NoCaptue
)
$targetDir = "C:/temp/ftr-target"
Write-Host "Running ftr tests..." -ForegroundColor Green
# Build first
Write-Host "`nBuilding project..." -ForegroundColor Cyan
cargo build --target-dir $targetDir
if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed!" -ForegroundColor Red
exit 1
}
# Run tests with empty filter to avoid the "2" issue
Write-Host "`nRunning tests..." -ForegroundColor Cyan
$args = @("test", "--target-dir", $targetDir, "--")
if ($Filter) {
$args += $Filter
} else {
# Pass empty string to avoid default filter
$args += ""
}
if ($NoCaptue) {
$args += "--nocapture"
}
if ($Verbose) {
$args += "--verbose"
}
cargo @args
if ($LASTEXITCODE -eq 0) {
Write-Host "`nAll tests passed!" -ForegroundColor Green
} else {
Write-Host "`nSome tests failed!" -ForegroundColor Red
exit 1
}