File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ $ErrorActionPreference = " Stop"
2+
3+ function Invoke-Cargo {
4+ & cargo run -- @args
5+ if ($LASTEXITCODE -ne 0 ) { exit $LASTEXITCODE }
6+ }
7+
8+ $examplesDir = Join-Path $PSScriptRoot " examples"
9+ $simfFiles = Get-ChildItem - Path $examplesDir - Filter " *.simf" | Sort-Object Name
10+
11+ foreach ($simf in $simfFiles ) {
12+ $base = $simf.BaseName
13+ $argsFile = Join-Path $examplesDir " $base .args"
14+ $witFiles = Get-ChildItem - Path $examplesDir - Filter " *.wit" |
15+ Where-Object { $_.Name -like " $base .*" } |
16+ Sort-Object Name
17+
18+ $baseArgs = @ ($simf.FullName , " --deny-warnings" )
19+ if (Test-Path $argsFile ) {
20+ $baseArgs += " -a" , $argsFile
21+ }
22+
23+ # Run without witness
24+ Write-Host " `n === $base (no witness) ===" - ForegroundColor Cyan
25+ Invoke-Cargo @baseArgs
26+
27+ # Run once per .wit file
28+ foreach ($wit in $witFiles ) {
29+ Write-Host " `n === $base + $ ( $wit.Name ) ===" - ForegroundColor Cyan
30+ $witArgs = $baseArgs + @ (" -w" , $wit.FullName )
31+ Invoke-Cargo @witArgs
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ examples_dir=" $( dirname " $0 " ) /examples"
5+
6+ for simf in " $examples_dir " /* .simf; do
7+ base=$( basename " $simf " .simf)
8+ args_file=" $examples_dir /$base .args"
9+
10+ base_args=(" $simf " " --deny-warnings" )
11+ if [ -f " $args_file " ]; then
12+ base_args+=(" -a" " $args_file " )
13+ fi
14+
15+ # Run without witness
16+ echo " "
17+ echo " === $base (no witness) ==="
18+ cargo run -- " ${base_args[@]} "
19+
20+ # Run once per .wit file
21+ for wit in " $examples_dir /$base " .* .wit " $examples_dir /$base " .wit; do
22+ [ -f " $wit " ] || continue
23+ echo " "
24+ echo " === $base + $( basename " $wit " ) ==="
25+ cargo run -- " ${base_args[@]} " -w " $wit "
26+ done
27+ done
You can’t perform that action at this time.
0 commit comments