2020-03-18 04:56:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-04-07 04:32:19 +00:00
|
|
|
duration='2'
|
2020-06-22 18:33:12 +00:00
|
|
|
function wait_seconds() { perl -e 'alarm shift; exec @ARGV' "$@"; }
|
2020-03-18 04:56:27 +00:00
|
|
|
run_example() {
|
2020-04-07 04:32:19 +00:00
|
|
|
cargo build --example $1
|
2020-06-22 18:33:12 +00:00
|
|
|
wait_seconds "$duration" cargo run --example $1
|
2020-03-18 04:56:27 +00:00
|
|
|
}
|
|
|
|
|
2020-05-01 20:55:07 +00:00
|
|
|
example_list="$(cargo build --example 2>&1)"
|
|
|
|
example_list=${example_list//$'\n'/}
|
|
|
|
example_list="${example_list#error\: \"--example\" takes one argument.Available examples\: }"
|
|
|
|
echo $example_list
|
|
|
|
for example in $example_list
|
2020-03-18 04:56:27 +00:00
|
|
|
do
|
2020-05-01 20:55:07 +00:00
|
|
|
echo "Running example: $example"
|
|
|
|
run_example $example
|
2020-03-18 04:56:27 +00:00
|
|
|
done
|