-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrae.ps1
More file actions
47 lines (38 loc) · 1.06 KB
/
rae.ps1
File metadata and controls
47 lines (38 loc) · 1.06 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
param(
[switch]$SkipBuild
)
$ErrorActionPreference = "Stop"
$repoRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $repoRoot
if (-not $SkipBuild) {
Write-Host "Building release binary..."
cargo build --release
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
$runner = Join-Path $repoRoot "target\release\nimble.exe"
if (-not (Test-Path $runner)) {
Write-Error "Missing release binary at $runner"
exit 1
}
$failures = @()
$examples = Get-ChildItem -Path examples -Recurse -Filter *.nmb | Sort-Object FullName
foreach ($example in $examples) {
Write-Host ""
Write-Host "===== Running: $($example.Name) ====="
Write-Host ""
$output = & $runner run $example.FullName 2>&1
if ($output) {
$output | ForEach-Object { Write-Host $_ }
}
if ($LASTEXITCODE -ne 0 -or (($output | Out-String) -match "\[ERROR\]")) {
$failures += $example.FullName
}
}
if ($failures.Count -gt 0) {
Write-Host ""
Write-Host "Failures:"
$failures | ForEach-Object { Write-Host $_ }
exit 1
}