From 96d7b7fedfc0740df194b168d9ed96d2eb1681fc Mon Sep 17 00:00:00 2001 From: marc0246 <40955683+marc0246@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:04:47 +0100 Subject: [PATCH] Add `run_all.ps1` and `run_all_headless.ps1` --- examples/run_all.ps1 | 3 +++ examples/run_all_headless.ps1 | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 examples/run_all.ps1 create mode 100644 examples/run_all_headless.ps1 diff --git a/examples/run_all.ps1 b/examples/run_all.ps1 new file mode 100644 index 0000000000..9cbd8b2bb9 --- /dev/null +++ b/examples/run_all.ps1 @@ -0,0 +1,3 @@ +cargo build --bins +@(Get-ChildItem -Directory -Name) | %{cargo run --bin $_} +rm pipeline-caching\pipeline_cache.bin diff --git a/examples/run_all_headless.ps1 b/examples/run_all_headless.ps1 new file mode 100644 index 0000000000..edf1fddd58 --- /dev/null +++ b/examples/run_all_headless.ps1 @@ -0,0 +1,13 @@ +foreach ($example in Get-ChildItem -Directory -Name) { + $proc = Start-Process -FilePath "cargo" -ArgumentList "run --bin $example" -NoNewWindow -PassThru + + $timeouted = $null + + Wait-Process -InputObject $proc -Timeout 15 -ErrorAction SilentlyContinue -ErrorVariable timeouted + + if ($timeouted) { + kill $proc + } elseif ($proc.ExitCode -ne 0) { + Exit $proc.ExitCode + } +}