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.sh b/examples/run_all.sh index c03e4d18b7..4ab9947b6c 100755 --- a/examples/run_all.sh +++ b/examples/run_all.sh @@ -1,5 +1,5 @@ -#!/bin/bash -set -e +#!/usr/bin/env sh +set -eu # This script builds and runs all the examples # It is NOT headless @@ -7,5 +7,5 @@ set -e # Human monitoring is also required to check for errors in stdout cargo build --bins -exa -F . | rg '/$' | sd '/' '' | rargs cargo run --bin {} +ls -F | grep '/$' | sed 's|/||' | xargs -E '' -I {} cargo run --bin {} rm -f 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..5b28584794 --- /dev/null +++ b/examples/run_all_headless.ps1 @@ -0,0 +1,13 @@ +foreach ($example in Get-ChildItem -Directory -Name) { + $proc = Start-Process "cargo" "run --bin $example" -NoNewWindow -PassThru + + $timeouted = $null + + $proc | Wait-Process -Timeout 15 -ErrorAction SilentlyContinue -ErrorVariable timeouted + + if ($timeouted) { + $proc | Stop-Process + } elseif ($proc.ExitCode -ne 0) { + Exit $proc.ExitCode + } +} diff --git a/examples/run_all_headless.sh b/examples/run_all_headless.sh new file mode 100755 index 0000000000..27b809abdf --- /dev/null +++ b/examples/run_all_headless.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +set -eu + +ls -F | grep '/$' | sed 's|/$||' | xargs -E '' -I {} timeout --preserve-status 15s cargo run --bin {} +rm -f pipeline-caching/pipeline_cache.bin