Skip to content

Commit

Permalink
example showcase: use a more cross-platform friendly timer
Browse files Browse the repository at this point in the history
  • Loading branch information
carter authored and carter committed Jun 22, 2020
1 parent fa9348f commit 9e12031
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/example_showcase.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash

duration='2'
function wait_seconds() { perl -e 'alarm shift; exec @ARGV' "$@"; }
run_example() {
cargo build --example $1
timeout "$duration" cargo run --example $1
wait_seconds "$duration" cargo run --example $1
}

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
do
Expand Down

0 comments on commit 9e12031

Please sign in to comment.